Self-Hosting dotCMS on a VPS: A Complete Production Guide
VPS and Domain Setup
1. Provision Your VPS#
Create a new server on your cloud provider and choose:
- Region: nearest to your users for lower latency
- OS: Ubuntu 22.04 LTS
- Plan: 4 GB RAM minimum; 8 GB recommended if running the full stack in this guide
After your VPS is provisioned, note the assigned IP address.
2. Reserve a Static IP#
By default, cloud VPS IPs are dynamic — they may change if the server restarts. Before pointing your domain, assign a static (reserved) IP:
- DigitalOcean: Networking → Reserved IPs → Create Reserved IP → assign to your droplet
- Hetzner: Floating IPs section
- AWS/Azure/GCP: Elastic IP / Static IP equivalents
This is essential. Your domain A records will point to this IP, and it must not change.
3. Point Your Domain to the VPS#
In your DNS provider, create an A record for each subdomain you'll use:
| Hostname | Type | Value |
|---|---|---|
dotcms.info | A | YOUR_STATIC_IP |
portainer.dotcms.info | A | YOUR_STATIC_IP |
home.dotcms.info | A | YOUR_STATIC_IP |
metrics.dotcms.info | A | YOUR_STATIC_IP |
Tip: Most cloud providers include a built-in DNS management service. You can use it to create your A records without needing a third-party DNS provider.
Verify DNS is propagating:
ping dotcms.info # Should resolve to YOUR_STATIC_IP
4. Log In to Your VPS#
ssh root@YOUR_STATIC_IP # Or using your domain once DNS propagates: ssh root@dotcms.info
Next up
Chapter 2: Securing Your VPS