keepcalculator

06 Numbers and Powers

Start a Shared Hosting Business on a VPS

Card No. 06·62658 · Updated · Standard formula, shown below

This guide walks you through turning a single virtual private server (VPS) into a shared hosting platform you can sell to clients. You’ll learn how to install the necessary software, create reseller accounts, set up billing, and avoid common pitfalls. Before you start, you need a VPS with at least 4GB of RAM, a domain name for your hosting brand, and a basic comfort with the Linux command line.

What You’ll Need

  • A VPS running Ubuntu 22.04 or 24.04 (or Debian 12) with a static IP address
  • Root or sudo access to the server
  • A domain name (e.g., yourhosting.com) – you’ll set up nameservers for your clients
  • A control panel license – free options like HestiaCP or VestaCP, or paid like cPanel/WHM (budget accordingly)
  • SSH client (like PuTTY on Windows, or Terminal on macOS/Linux)
  • A billing system – WHMCS, Blesta, or even a simple invoicing script
  • Basic knowledge of DNS, Apache/Nginx, and email server concepts

Step-by-Step

  1. Secure your VPS – Log in via SSH and update the system: apt update && apt upgrade -y. Create a non-root user with sudo privileges, disable root login in /etc/ssh/sshd_config, and set up a firewall (UFW) to allow only SSH (port 22), HTTP (80), HTTPS (443), and mail ports (25, 587, 993, 995).
  2. Point your domain to the VPS – At your domain registrar, create two nameserver records (e.g., ns1.yourhosting.com and ns2.yourhosting.com) pointing to your VPS’s IP. Then, on the VPS, install a DNS server like PowerDNS or use the built-in DNS manager in your control panel. This lets you host client domains.
  3. Install a control panel – For HestiaCP, run the one-line installer from their official site. For cPanel, you’ll need a license and a clean CentOS/AlmaLinux server. Follow the installer’s prompts – it will ask for your hostname (e.g., server.yourhosting.com) and admin email.
  4. Configure the control panel – Access the admin interface via https://your-server-ip:8083 (for HestiaCP). Set up your company name, default nameservers (ns1.yourhosting.com, ns2.yourhosting.com), and create an admin user. Enable the web server (Apache or Nginx), PHP versions (7.4, 8.1, 8.2), and mail server (Exim or Dovecot).
  5. Set up reseller accounts – In HestiaCP, go to ‘Users’ and create a new user with ‘Reseller’ type. Assign a resource quota (e.g., 20GB disk, 2GB RAM, 50 domains). This user can then create their own client accounts, each with isolated web, mail, and database access.
  6. Create a package for clients – As the reseller, log in to the user panel and define a hosting package (e.g., ‘Starter’ – 5GB disk, 10 domains, 2 databases). This package is what your end customers will purchase.
  7. Set up billing automation – Install WHMCS or Blesta on a separate VPS or a subdomain (e.g., billing.yourhosting.com). Connect it to your control panel via the API (HestiaCP has a simple API; cPanel uses WHM API). Configure product pricing, payment gateways (PayPal, Stripe), and automatic account provisioning – when a client pays, the system creates the hosting account for you.
  8. Configure email and DNS – Ensure your control panel’s DNS templates are set to use your nameservers. Test sending and receiving email from a client account – check SPF, DKIM, and DMARC records are automatically added.
  9. Add a support system – Set up a helpdesk (like osTicket) on a subdomain. Create canned responses for common issues (password reset, domain propagation).
  10. Test everything – Create a test client account, upload a simple WordPress site, point a test domain to your nameservers, and verify the site loads. Send a test email to an external inbox. Run a speed test (GTmetrix) to ensure performance is acceptable.
  11. Go live – Update your website with hosting plans, create a signup page, and start marketing. Monitor your server with tools like Netdata or Munin to watch resource usage.

Common Mistakes

  • Underestimating resource needs – A 2GB VPS will struggle with more than a few small sites. Start with 4GB and upgrade as you grow.
  • Ignoring security – Not updating the OS, leaving default ports open, or using weak passwords invites attacks. Enable fail2ban and keep everything patched.
  • Overselling carelessly – Overselling (selling more disk than you physically have) is common, but without monitoring you’ll run out of space. Use quotas and monitor disk usage weekly.
  • Poor backup strategy – Relying on the VPS provider’s backups is not enough. Set up offsite backups (e.g., to a cloud storage bucket) for every client account.
  • Not isolating customers – Without proper user separation, one client’s script can read another’s files. Ensure the control panel uses PHP-FPM with per-user pools.
  • Neglecting email deliverability – If you don’t set up SPF/DKIM correctly, client emails go to spam. Test with tools like mail-tester.com.

Tips

  • Start with a small number of clients (5-10) to learn the operational side before scaling.
  • Use a separate VPS for billing and support to keep your main hosting server clean.
  • Automate backups with a cron job – e.g., daily database dumps and weekly full backups.
  • Offer a free SSL certificate (Let’s Encrypt) – it’s expected now.
  • Create a simple knowledge base for clients to reduce support tickets.
  • Monitor your server’s load average and disk I/O – shared hosting is resource-intensive.

Troubleshooting

Clients can’t point their domain to your nameservers – Ensure ns1 and ns2 records exist at your registrar and that port 53 (UDP/TCP) is open in your firewall. Test with dig @your-server-ip yourdomain.com.

Websites load slowly – Check memory usage (free -m) and CPU (top). Enable caching (e.g., LiteSpeed Cache or Nginx FastCGI cache). Upgrade your VPS if sustained load exceeds 80%.

Email not sending/receiving – Check that port 25 is not blocked by your VPS provider (some block it). Verify MX records for the client domain. Look at mail logs (/var/log/exim/mainlog).

Control panel won’t start – Reboot the VPS. If it still fails, check the service status (systemctl status hestia). Re-run the installer’s repair script if needed.

Out of disk space – Use du -sh /home/* to find large users. Consider compressing old backups or moving them to external storage.

Billing system doesn’t provision accounts – Verify API credentials in WHMCS/Blesta. Test the API manually with curl. Ensure the control panel’s API is enabled and the IP is whitelisted.

Frequently Asked Questions

Do I need a dedicated IP for each client?

No, shared hosting typically uses one IP for all sites, but you may need a dedicated IP for clients who want SSL on older setups or for special DNS needs.

Can I use a free control panel like HestiaCP for a business?

Yes, HestiaCP is free and open-source, but you must provide support and updates yourself. It’s reliable for small to medium setups.

How many clients can I host on a 4GB VPS?

It varies widely – typically 20-50 low-traffic websites, depending on the CMS and plugins. Monitor your resources and adjust.

Do I need to register a separate business entity?

That depends on your local laws. Many start as sole proprietors, but a limited liability company (LLC) is recommended to protect personal assets.

What happens if a client’s site gets hacked?

You should isolate the account, restore from a clean backup, and advise the client to update their scripts. Implement security modules like mod_security to reduce risks.

Can I offer reseller hosting to others?

Yes, that’s what you’re doing – you’re a reseller of your VPS. You can also create sub-resellers if your control panel allows it, but that adds complexity.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →