This note records a minimal New API deployment with Docker Compose.
Example values:
- public domain:
newapi.example.com - public HTTPS port:
8445 - container app port:
3000 - repo:
https://github.com/QuantumNous/new-api.git
The domain and port are examples. Replace them with your own values.
Install Docker
If Docker is not installed yet:
curl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shCheck it:
docker versiondocker compose versionClone
git clone https://github.com/QuantumNous/new-api.gitcd new-apiReview the compose file before starting it:
vim docker-compose.ymlFor a reverse-proxy setup, bind the app to localhost if the compose file allows it:
ports: - "127.0.0.1:3000:3000"If the upstream compose file also starts MySQL and Redis, keep their ports internal unless you have a reason to expose them.
Start
docker compose up -dCheck status:
docker compose psdocker compose logs -f new-apidocker compose logs --tail=100 new-apiFor first-time initialization, open the web page and follow the setup wizard:
https://newapi.example.com:8445If you test without Caddy first, use:
http://198.51.100.20:3000198.51.100.20 is a documentation IP address.
Caddy Reverse Proxy
Caddy config:
newapi.example.com:8445 { reverse_proxy 127.0.0.1:3000}Reload Caddy:
sudo caddy validate --config /etc/caddy/Caddyfilesudo systemctl reload caddyOpen the firewall port if needed:
sudo nft add rule inet filter input tcp dport 8445 acceptUpdate
cd /opt/new-apigit pulldocker compose pulldocker compose up -ddocker image prune -fIf you modified tracked files directly and git pull complains, either move local changes into override files or clean the tree intentionally. Do not blindly reset --hard unless you know what you are throwing away.
Logs
# all servicesdocker compose logs -f
# selected servicesdocker compose logs -f new-apidocker compose logs -f mysqldocker compose logs -f redis
# foreground debugdocker compose up new-api