How can I temporarily hide website for a couple of days while I still work on my website?

I just want to disable my website for a couple of days.

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can set a firewall rule to allow only from your IP address

As @gparent said, the easiest way is to just shut down your web server. Now if you need to access your site while working on it but don’t want anyone else to I sometimes find it handy to point your DNS record elsewhere and set up an entry in the hosts file on my local computer so the domain works for me but nobody else. The hosts file can be found in /etc/hosts on Linux and Mac and in C:\Windows\system32\drivers\etc on Windows. The format is just the domain name and an IP address in the order shown in the file. Just make sure to delete the entry when you’re ready to go live or you may end up running into confusing results trying to troubleshoot a problem in the future.

You could use service nginx stop or service apache2 stop to turn off your web server.