I have multiple Website and recently started using Digital Ocean to host multiple Websites. I have created Ubuntu 18.04 64 bit droplet to use following software.
- Web Server (Apache or Nginx)
- Database Server (MySQL)
- Email (Dovecot, Postfix)
- Webmail Client
- SSL Certificate (Let’s Encrypt)
1 CPU, 1GB RAM droplet is good enough for my need.
Even though Digital Ocean has multiple tutorials for installing Webmin, Apache, MySQL, Dovecot, PostFix, don’t use those tutorials. Those tutorials are meant for those who are running only individual components and requires higher level of knowledge of each component.
If you are an individual and want to get rid of shared hosting, this tutorial is for you.
When you are moving away from shared hosting, burden of maintaining Web server, database server, email server, SSL certificate etc on you.
Even though Digital Ocean does not recommend running Email server on the same server which hosts database and website, you may want to host it on the same server because your traffic is moderate enough.
Let’s start the setup
Initial server setup
Follow this tutorial to setup your Ubuntu 18.04 server for initial setup. Only follow
- Step 1 – Logging in as Root
- Step 2 — Creating a New User
- Step 3 — Granting Administrative Privileges
- Step 4, 5 – STOP. Do not follow these steps. These steps are not needed. Webmin installs and setup firewall. Following step 4 would cause problem with Webmin installation.
During the installation, it checked for upgrade. It had found grub/menu.lst file change. I clicked on checking the diffs between two version but did not find any non-space changes so I kept using the local version.
Install and setup Webmin
Follow this tutorial to setup Webmin/Virtualmin. Even though this tutorial is for Ubuntu 16.04, it works for Ubuntu 18.04. Before you start the setup, follow the best practice that I came up with in order to host multiple Website.
Installing Virtualmin asked to install LAMP and also warned me of memory issue. I went ahead with “y” and allowed it to create “swap”. By default, it created swap for 270 MB.
During the installation, log showed following items are installed
- Removed nginx
- Lamp stack
Once everything is up and running, now it is a time to disable/remove unwanted software/service and install other components.
Install Lets Encrypt package
I went to “Webmin” > “Webmin Configuration” > “SSL Encryption” and clicked on “Install Now” button. It checks for the dependent packages and then enables “Install Now” and it install the Lets Encrypt.
Remove BIND, ProFTPD, DAV Login
Go to VirtualMin > System Settings > Features and Plugins > Removed following features
- BIND DNS domain
- DAV Login
Change server time
Go to Webmin > Hardware > System Time and change timezone
Increase swap size
Follow this tutorial to increase swap size to 2 GB.
I faced some networking issue. I don’t remember the exact error but here is a fix.
Go to Virtualmin -> System Settings -> Virtualmin Configuration -> Network Settings and set “Network interface for virtual addresses” Detect automatically. Also Default IP address for DNS records > change it to “Same as virtual server IP”. Once you save it, it will ask to reverify the configuration. Click on the button to reverify configuration.