Self-Hosting CloudAIPilot Using App Workflows
Who this is for
Users or teams who want to run their own self-hosted instance of CloudAIPilot — for example, to keep all management traffic within their own network, meet compliance requirements, or customize the platform.
Overview
CloudAIPilot can be deployed as a self-hosted instance using the Compose App workflow. The platform itself ships as a set of Docker services that can be managed on any server you control.
For the detailed technical runbook, see SELF-HOSTING-RUNBOOK.md.
What You Need
| Requirement | Details |
|---|---|
| A server | At least 2 CPU cores, 4 GB RAM, 40 GB disk |
| Docker + Docker Compose | Installed on the server |
| A domain | For the self-hosted dashboard (e.g., cloudpilot.mycompany.com) |
| PostgreSQL | 15+ (can run as a container or managed service) |
| Redis | 7+ (can run as a container) |
| SMTP server | For transactional emails (password reset, alerts) |
High-Level Deployment Steps
- Provision a server — provision a new server with at least 2 vCPUs and 4 GB RAM. See KB-02-02: Provision a New Server.
- Install Docker and Docker Compose on the server if not already installed (the server must be set up as a bare server for self-hosting).
- Create a Compose App using the
docker-compose.prod.ymlfrom the CloudAIPilot repository — see KB-04-04: Create a Compose App from Git.
- Set required environment variables — see the full list in SELF-HOSTING-RUNBOOK.md. Key variables include:
DATABASE_URL— PostgreSQL connection stringREDIS_URL— Redis connection stringJWT_SECRET— for token signingENCRYPTION_KEY— for AES-256-GCM credential encryptionNEXTAUTH_URL— the URL of your self-hosted dashboardSMTP_*— SMTP credentials for emails
- Add a domain to the compose app and issue SSL — see KB-04-09: App Domains and SSL.
- Run database migrations:
SSH into the server and run:
docker compose exec api npx prisma migrate deploy
- Create the first admin account by visiting your self-hosted URL and completing the setup wizard.
Services in the Compose Stack
| Service | Description |
|---|---|
api | Fastify backend (port 4000) |
web | Next.js frontend (port 3000) |
agent | AI agent service |
postgres | PostgreSQL database (if running in-container) |
redis | Redis cache and pub/sub (if running in-container) |
Upgrading a Self-Hosted Instance
- Pull the latest changes from git:
git pull origin main - Run migrations:
docker compose exec api npx prisma migrate deploy - Redeploy via CloudAIPilot's app redeploy, or run:
docker compose up -d --build
Support for Self-Hosted Instances
Self-hosted deployments are supported by the CloudAIPilot community and documentation. For critical production use, consider the managed SaaS version at cloudaipilot.com.
Related Articles
- KB-04-03: Create a Compose App from YAML
- KB-04-04: Create a Compose App from Git
- KB-04-09: App Domains and SSL
- Self-Hosting Runbook