Netease Cloud Music API Standard Deployment
Based on NeteaseCloudMusicApi project.
Requirements
- Node.js 14+
Recommended Methods
| Method | Best for | Entry point |
|---|---|---|
npm install | Persistent deployment with pinned dependencies | npm install NeteaseCloudMusicApi@latest |
npx | Quick trial run | npx NeteaseCloudMusicApi@latest |
bunx | One-shot startup with Bun | bunx NeteaseCloudMusicApi@latest |
| Docker Compose | Long-running container deployment | oven/bun:alpine + bunx NeteaseCloudMusicApi |
::: note npm install is the better fit for persistent deployment. npx / bunx download the package on first run and are better suited to quick validation. :::
NPM Package Deployment
1. Initialize a working directory
shell
mkdir netease-cloud-music-api
cd netease-cloud-music-api
npm init -y2. Install dependencies
shell
npm install NeteaseCloudMusicApi@latest3. Run
shell
npx NeteaseCloudMusicApi4. Customize port
Linux/macOS
shell
PORT=4000 npx NeteaseCloudMusicApiWindows
bat
set PORT=4000 && npx NeteaseCloudMusicApiNPX / Bunx Quick Start
Default port 3000
shell
npx NeteaseCloudMusicApi@latestshell
bunx NeteaseCloudMusicApi@latestCustom port
shell
PORT=4000 npx NeteaseCloudMusicApi@latestshell
PORT=4000 bunx NeteaseCloudMusicApi@latestWindows
bat
set PORT=4000 && npx NeteaseCloudMusicApi@latest
set PORT=4000 && bunx NeteaseCloudMusicApi@latestDocker Compose
This setup runs bunx NeteaseCloudMusicApi directly inside a Bun base image, so you do not need to rely on an old prebuilt image.
yaml
services:
ncm-api:
image: oven/bun:alpine
container_name: ncm-api
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- "127.0.0.1:3000:3000"
command: bunx NeteaseCloudMusicApi
networks:
- 1panel-network
deploy:
resources:
limits:
memory: 256M
networks:
1panel-network:
external: trueStart it with:
shell
docker compose up -dIf you are not using 1Panel, replace 1panel-network with your own network name, or remove the networks section to let Compose create the default network.
FAQ
Login failed
If you encounter login issues, please try using email login.