I have multiple Websites 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 (RoundCube)
- SSL Certificate (Let’s Encrypt)
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
- 2 – Creating a New User
- 3 – Granting Administrative Privileges
- 4, 5 – STOP. Do not follow these steps. These steps are not needed. Webmin installs and setup firewall. Following the 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
Before you start the setup, follow the best practice that I came up with in order to host multiple Website.
Follow this tutorial to setup Webmin/Virtualmin. Even though this tutorial is for Ubuntu 16.04, it works for Ubuntu 18.04.
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
1GB RAM is not good enough to run 4 WordPress Websites along with email. In order to get optimal performance, you need Swap. Webmin creates a swap of 270 MB so 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.