How to delete a domain name include the folders etc

  • Posted on September 20, 2014
  • mdamonsmaAsked by mdamonsma

How can I delete a website include the folder etc? I use ubuntu and I have a few domain names on my server.

But how can I delete a “website” from my server?

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.

First, you should delete the corresponding DNS records so that it’s no longer pointing to your droplet. Once you’ve done that, you can delete the virtualhost configuration file which is usually in /etc/apache2/sites-enabled or /etc/nginx/sites-enabled.

You can then delete the website’s files by running (replace /var/www/website with the actual path to your website’s files):

rm -r /var/www/website

If you have a MySQL database, you’ll probably want to delete it too:

mysql -u mysql_username -p

Enter your MySQL user’s password and you should be logged in to a MySQL prompt (mysql>). Run the following command to delete the website’s database:

DROP DATABASE `database_name`