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

RequirementDetails
A serverAt least 2 CPU cores, 4 GB RAM, 40 GB disk
Docker + Docker ComposeInstalled on the server
A domainFor the self-hosted dashboard (e.g., cloudpilot.mycompany.com)
PostgreSQL15+ (can run as a container or managed service)
Redis7+ (can run as a container)
SMTP serverFor transactional emails (password reset, alerts)

High-Level Deployment Steps

  1. Provision a server — provision a new server with at least 2 vCPUs and 4 GB RAM. See KB-02-02: Provision a New Server.
  1. 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).
  1. Create a Compose App using the docker-compose.prod.yml from the CloudAIPilot repository — see KB-04-04: Create a Compose App from Git.
  1. Set required environment variables — see the full list in SELF-HOSTING-RUNBOOK.md. Key variables include:
  • DATABASE_URL — PostgreSQL connection string
  • REDIS_URL — Redis connection string
  • JWT_SECRET — for token signing
  • ENCRYPTION_KEY — for AES-256-GCM credential encryption
  • NEXTAUTH_URL — the URL of your self-hosted dashboard
  • SMTP_* — SMTP credentials for emails
  1. Add a domain to the compose app and issue SSL — see KB-04-09: App Domains and SSL.
  1. Run database migrations:

SSH into the server and run:

   docker compose exec api npx prisma migrate deploy
  1. Create the first admin account by visiting your self-hosted URL and completing the setup wizard.

Services in the Compose Stack

ServiceDescription
apiFastify backend (port 4000)
webNext.js frontend (port 3000)
agentAI agent service
postgresPostgreSQL database (if running in-container)
redisRedis cache and pub/sub (if running in-container)

Upgrading a Self-Hosted Instance

  1. Pull the latest changes from git: git pull origin main
  2. Run migrations: docker compose exec api npx prisma migrate deploy
  3. 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