Self-Hosting dotCMS on a VPS: A Complete Production Guide
Deploy dotCMS
1. Get the Docker Compose File#
Visit the dotCMS Current Releases page and download the Docker Compose file for the version you want. For a demo site with sample content, use the dotCMS Demo Site compose file. For a clean install, use the bare dotCMS compose file.
The compose file includes three services:
db— PostgreSQL 18 (the recommended database)opensearch— for content search and indexingdotcms— the main application
2. Deploy via Portainer Stacks#
- In Portainer, go to Stacks → Add Stack
- Give it a name:
dotcms - Paste the Docker Compose file contents into the web editor
- Before deploying, review these settings:
Admin password: Find DOT_INITIAL_ADMIN_PASSWORD in the environment section. This is the default password for admin@dotcms.com. Either change it from the default admin to something strong, or blank it out and leave the system to generate its own secure password randomly. The generated password can be found in the system logs on its first startup, in a block similar to this one:
####################################################################### ## NOTICE: admin@dotcms.com password set to Bzqk#s4=TCwe3@ ## ## WARNING: Once logged in. Please change this password. ## #######################################################################
| Port mapping | dotCMS Exposes | Notes |
|---|---|---|
8082 | HTTP | Use this for the Caddy reverse proxy |
8443 | HTTPS | Not needed since Caddy handles TLS |
4000 | Glowroot | Optional, can be removed if not needed |
Remove the 8443 and 4000 port mappings if you're using Caddy to handle HTTPS.
- Click Deploy the Stack
Portainer will pull the images (PostgreSQL, OpenSearch, dotCMS) and start all three containers. This takes 2–5 minutes depending on your connection speed.
Monitor progress by clicking the stack name → selecting the dotcms container → viewing its logs. Look for the starter site download completing.
3. Update Caddy to Route to dotCMS#
sudo nano /etc/caddy/Caddyfile
dotcms.info { reverse_proxy localhost:8082 } portainer.dotcms.info { reverse_proxy localhost:9000 }
Reload Caddy:
caddy reload --config /etc/caddy/Caddyfile
4. Verify dotCMS is Running#
Open https://dotcms.info in a browser. You should see the dotCMS demo site.
To access the admin panel, go to https://dotcms.info/dotAdmin. Log in with:
- Email:
admin@dotcms.com - Password: the value you set for
DOT_INITIAL_ADMIN_PASSWORD
Inside the admin panel you can:
- Navigate to Site → Pages to view and edit content
- Use the Universal Visual Editor (UVE) to edit content inline on the live site
- Manage Content Types, workflows, and user permissions
Quick test: Open a page in UVE, change the headline text, and publish. Refresh https://dotcms.info to confirm the change is live.
Next up
Chapter 6: Deploy Homarr Dashboard (Optional)