One VPS to Rule Them All
For the past three years, I’ve been running a versatile $5/month VPS that handles multiple services including static websites, a Nextcloud server, and an email server. Let’s examine my setup and the measures I’ve taken to optimize this single-server solution.
NOTE: This setup works well for most services, but Docker containers may require more resources than available on a basic VPS.
TOC
Main features
Hosting Static Websites
There’s no much mystery to this. I simply serve all my static sites with nginx. I also have them setup so that http always redirects to https.
Nextcloud Server
Nextcloud provides file synchronization and sharing capabilities. While it requires more resources than other services, it offers powerful functionality. Hosting it on my VPS provides data control and remote access. The installation was straightforward, especially with nginx already configured.
Email Server
Setting up an email server can be daunting, but with the right tools, it’s achievable. I configured my server using the emailwiz script, which simplifies the installation of Postfix, Dovecot, SpamAssassin, and OpenDKIM. This ensures secure and private communication. I managed to set it up so that it admits multiple domains. Took me some time but it was worth it!
Security Measures
HTTPS Redirection
To enhance security, all my Nginx-hosted websites automatically redirect HTTP traffic to HTTPS. This ensures that all data transmitted between users and the server is encrypted, protecting against potential eavesdropping.
SSH Key Authentication
I configured the server to allow only SSH key-based authentication, which prevents brute-force attacks. I also have two-factor authentication (2FA) through my VPS provider as a backup measure.
Automatic Certificate Renewal
I use Certbot for automatic SSL certificate renewal, eliminating the need to manually manage certificate expiration. The renewal process is managed by cron jobs, ensuring seamless operation.
Auto Package Updates
To ensure my server is always up to date with the latest security patches and features, I set up automatic package updates. This minimizes vulnerabilities and keeps my services running smoothly.
Conclusion
This three-year experience has provided valuable insights into VPS hosting. With a simple setup, I’m able to host multiple services securely and efficiently. Whether you want to run static websites, a cloud server, or manage your email with multi-domain support, a single VPS can handle diverse requirements cost-effectively.
NOTE: Docker containers may require more resources than available on a basic VPS.