Docker Deployment
This document provides detailed steps for deploying New API using Docker.
Highly Recommended
We highly recommend using the Docker Compose installation method instead of manually starting Docker containers. The Docker Compose method offers better configuration management, service orchestration, and deployment experience.
Basic Requirements
- Docker environment installed
- Port: Default port 3000 is used
Deploy Directly Using Docker Image
Using PostgreSQL (Recommended)
PostgreSQL is the preferred database for production deployments:
docker run --name new-api -d --restart always \
-p 3000:3000 \
-e SQL_DSN="postgresql://username:password@database-host:5432/database-name" \
-e TZ=Asia/Shanghai \
-v /your/data/path:/data \
calciumion/new-api:latestChoosing a database
PostgreSQL is preferred for production. New API remains compatible with MySQL, while SQLite is intended for local evaluation and temporary tests.
Using MySQL (Compatible)
docker run --name new-api -d --restart always \
-p 3000:3000 \
-e SQL_DSN="username:password@tcp(database-host:3306)/database-name" \
-e TZ=Asia/Shanghai \
-v /your/data/path:/data \
calciumion/new-api:latestUsing SQLite (Testing Only)
docker run --name new-api -d --restart always \
-p 3000:3000 \
-e TZ=Asia/Shanghai \
-v /your/data/path:/data \
calciumion/new-api:latestNote
Please replace /your/data/path with your desired local path for data
storage.
Accessing the System
After deployment, accessing http://Server_IP:3000 will automatically redirect you to the initialization page. Follow the on-screen instructions to manually set up the administrator account and password (only required for the first installation), and upon completion, you can log in to the system with the newly set administrator account.
How is this guide?
Last updated on