Create a Container App from an Image
Who this is for
Users who want to run a pre-built Docker image (from Docker Hub, GitHub Container Registry, or any registry) on a server managed by CloudAIPilot.
Prerequisites
- Server is running with SSH connectivity and Docker installed.
- You know the Docker image reference (e.g.,
nginx:1.27,myuser/myapp:latest). - If using a private registry: the server can authenticate to it (see note on private registry auth below).
How to Create a Container App
- Go to Servers → open the server.
- Click the Apps tab.
- Click + Create App.
- Select Container App.
- Fill in the form:
| Field | Description | Example |
|---|---|---|
| App name | Internal label in CloudAIPilot | my-api |
| Image reference | Docker image + tag | nginx:1.27 or ghcr.io/user/myapp:v2 |
| Host port | Port on the server to expose | 8080 |
| Container port | Port the app listens on inside the container | 80 |
| Health path | HTTP path for healthcheck (optional) | /health |
| Restart policy | When to restart the container | unless-stopped (default) |
| Command | Override Docker CMD (optional) | |
| CPU limit | Max CPU cores (optional) | 1.0 |
| Memory limit | Max RAM in MB (optional) | 512 |
| Environment variables | Key-value pairs passed to the container | NODE_ENV=production |
- Toggle Deploy now ON to start the container immediately after saving.
- Click Create.
Restart Policies
| Policy | Behavior |
|---|---|
unless-stopped (default) | Restarts automatically unless explicitly stopped |
always | Restarts on any exit, including manual stop |
on-failure | Restarts only on non-zero exit codes |
no | Never restarts automatically |
Use unless-stopped for most production apps. Use no for one-off jobs.
What Happens After Creation
- CloudAIPilot connects to the server via SSH.
- Runs
docker pullto fetch the image. - Runs
docker runwith the specified ports, env vars, and limits. - Monitors the container status.
The app appears in the Apps tab with status pending → running.
Progress is visible in the Activity Center.
After the App Is Running
- Add a custom domain to expose the app via Nginx — see KB-04-09: App Domains and SSL.
- Set up port forwarding rules if direct port access is needed — see KB-04-14: Port Mapping.
Private Registry Authentication
If your image is in a private registry, you must authenticate Docker on the server first:
- SSH into the server or use the Terminal tab.
- Run:
docker login ghcr.io -u your-username --password-stdin(then paste your token). - Or for Docker Hub:
docker login -u your-username
CloudAIPilot does not yet manage Docker registry credentials directly.
App Status Values
| Status | Meaning |
|---|---|
pending | App created, deploy triggered or queued |
running | Container is running |
stopped | Container is stopped (no auto-restart active) |
failed | Container exited with an error |
deleting | App is being cleaned up |
What Success Looks Like
App status shows running. If you set a host port, curl http:// returns a response from the container.
Common Issues and Fixes
| Issue | Likely cause | Fix |
|---|---|---|
| "PORT_CONFLICT" error | Host port already used by another app or site | Use a different host port, or check the Port Check feature. |
| App status stays "pending" | Docker pull failed or SSH issue | Check Activity Center logs. Verify image name and registry auth. |
| App status "failed" after deploy | Container exited — app crash | Check logs via the Logs tab — see KB-04-12: App Logs. |
| "NAME_CONFLICT" error | App name already used on this server | Use a different name. |
Related Articles
- KB-04-01: App vs Site
- KB-04-08: App Environment Variables
- KB-04-09: App Domains and SSL
- KB-04-12: App Logs and Diagnose
- KB-04-14: Port Mapping