The self-hosted edition is the same portal, running on your own servers. Your data stays with you: the only thing the portal sends to your provider is the hourly licence check-in (see Licence), and you can switch that off.
What you need#
- A Linux server, x86-64, with 2 vCPUs, 4 GB RAM and 40 GB disk or more. Docker is installed for you if it's missing.
- A domain name for the portal, e.g.
portal.example.com, pointing at the server. - Your licence key file (
.lic) and the release bundlecmp-selfhosted-<version>.tar.gzfrom your provider. - Either access to your provider's image registry (they give you sign-in details), or, without internet access, the image file
cmp-<version>-image.tar.gz.
Install#
tar -xzf cmp-selfhosted-<version>.tar.gz
cd cmp-selfhosted-<version>
sudo ./install.sh --image <registry/repository> # with registry access
sudo ./install.sh --image-tar cmp-<version>-image.tar.gz # without internet access
The installer asks for:
- The domain.
- HTTPS:
- Let's Encrypt, for servers reachable from the internet on ports 80 and 443;
- internal, for private networks: browsers need to trust the portal's own certificate authority;
- your own certificate, placed in
/opt/cmp/certs.
- Whether the server can reach the internet, so the licence renews by itself. Answer no for air-gapped servers.
- Your licence file.
- The first administrator's email and password.
Everything is installed under /opt/cmp. Settings are in /opt/cmp/.env, readable by root only.
After installing:
- Sign in and set up two-factor authentication under Settings › Security. The admin area needs it.
- Put your SMTP server in
/opt/cmp/.env(MAIL_MAILER=smtp,MAIL_HOST,MAIL_USERNAME,MAIL_PASSWORD,MAIL_FROM_ADDRESS), then runcmp restart. Until then, no email is sent: no invitations, password resets or alerts. - Connect your clouds, invite your team, and set up backups (below).
What runs#
| Container | Does |
|---|---|
web |
The portal. It updates the database when it starts. |
worker |
Background jobs: creating servers, syncing, notifications. |
scheduler |
Regular tasks: cloud sync every 5 minutes, billing, licence check-ins. |
relay |
The browser console. |
db, redis |
MariaDB database and Redis. |
proxy |
HTTPS (Caddy). |
The cmp command#
| Command | Does |
|---|---|
cmp status |
Containers and the licence. |
cmp logs [web|worker|…] |
Follow the logs. |
cmp restart |
Restart the portal, for example after changing .env. |
cmp backup [directory] |
Database and files in one .tar.gz, by default in /opt/cmp/backups. |
cmp restore <file> |
Replace the database and files with a backup. |
cmp update <version> |
Switch to another release. Add --image-tar <file> without internet access. |
cmp artisan <command> |
Run a portal command, e.g. cmp artisan cmp:license --status. |
Backups#
Run cmp backup daily, for example from cron:
15 2 * * * /usr/local/bin/cmp backup
Copy the backups off the server. A backup contains your settings and encryption key, so keep it as safe as the server.
The encryption key is APP_KEY in .env. Cloud credentials are encrypted with it, so a database without that key can't be restored.
Updates#
Your provider tells you about new versions. Updates are included while your licence's support and updates date has not passed.
cmp update 1.2.0
cmp update makes a backup first, then starts the new version, which updates the database by itself.
Your own reverse proxy or load balancer#
To put the portal behind your own proxy, remove the proxy service from docker-compose.yml. Then:
- forward to the
webcontainer on port 8080; - forward
/console/ws(WebSocket) to therelaycontainer on port 6080; - add the proxy's address to
TRUSTED_PROXIESin.env.
Troubleshooting#
- Not available / no valid licence: an admin must install the key under Admin › Licence, or with
cmp artisan cmp:license /path/key.lic. The key file must be readable inside the container: pipe it withcmp artisan cmp:license - < key.lic. - Not licensed for this hostname: the licence lists the domains it may run on. Use one of them, or ask your provider for a licence with your domain.
- Read-only: the licence expired or was revoked. Install a renewed key.
- Anything else:
cmp logs webandcmp logs workershow what went wrong. Send them to your provider's support.