Question

Website preview

I have set up a new droplet on Ubuntu 20.04 (LTS) x64 and have successfully installed the nginx mysql php lemp stack. Got two websites working on it and I have cloned the git repo for another ready to go live. I would like to test this one to make sure all is working ok before I update the nameservers. Is it possible to preview it in a browser somehow without changing the default site settings. To be honest I tried changing that and browsed to the IP of the droplet and it didn’t work. Any ideas? Thanks in advance.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
February 12, 2021
Accepted Answer

Hello, @lukep11a

You can simply edit the hosts file locally on your PC and server the website content from the DigitalOcean droplet.

The location of the file on Window / MacOs are:

  1. Windows PC c:/windows/system32/drivers/etc/hosts
  1. Mac OSX /private/etc/hosts

You can open the file in any text editor like Wordpad, Notepad and add the following line in the file:

DropletIP domain.com www.domain.com

On Windows, you need to run Wordpad or Notepad with administrator permissions (right-click -> run as administrator).

On MAC the best way to edit it is using terminal and typing “sudo nano /etc/hosts”, then adding the line and pressing Ctrl+X.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.