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

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

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

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel