Docker Single-instance Deploy
For trial / personal / small team. About 5 minutes.
One-command start
bash
docker run -d --name one-api-pro --restart always \
-p 3000:3000 \
-v $(pwd)/data:/app/data \
-e TZ=Asia/Shanghai \
ghcr.io/modelbus/one-api-pro:latestOpen http://localhost:3000. Default admin:
- Username:
root - Password:
123456
First thing: change the password after login (Personal Center).
Key flags explained
| Flag | Meaning |
|---|---|
-d | Run in background |
--restart always | Auto-restart on crash / Docker restart |
-p 3000:3000 | Map host port 3000 → container 3000 |
-v $(pwd)/data:/app/data | Persist DB and uploads to host ./data |
-e TZ=Asia/Shanghai | Time zone (affects log timestamps, cron) |
Next steps
In order:
- Change default password — log in → Personal Center → change password.
- Add a channel — Admin → Channels → Add, see Add a Channel.
- Configure model prices — Admin → Model Prices, see Model Price Management.
- (Optional) Reverse proxy — exposing port 3000 directly is unsafe for production; use Reverse Proxy.
- (Optional) Configure backups — see Backup & Restore.
Where data lives
Inside the container at /app/data:
one-api.db— main SQLite DBlogs/— exported call logsuploads/— uploaded files
Mounted to the host via -v — restarts / image upgrades do NOT lose data.
Tail logs
bash
docker logs -f one-api-proAdd -n 200 for the last 200 lines. Pair with Admin → Logs when troubleshooting.
Upgrade
bash
docker pull ghcr.io/modelbus/one-api-pro:latest
docker stop one-api-pro
docker rm one-api-pro
# re-run with the same flagsData stays in the mounted ./data. Full flow: Upgrade.
FAQ
- Forgot password:
docker exec -it one-api-pro one-api-pro reset-password root newpassword(v0.0.20+) - Container won't start:
docker logs one-api-pro— usually port 3000 already in use. - Want MySQL instead of SQLite: add
-e SQL_DSN='user:pass@tcp(host:3306)/db'.
Related
- System Requirements
- Docker Compose — for production
- Configuration
- Backup & Restore