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.
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!
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:
- Windows PC c:/windows/system32/drivers/etc/hosts
- 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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.