ZMusic 用户交流群

使用微信或企业微信扫码加入群聊

保存图片后,使用微信或企业微信识别二维码

ZMusic 用户交流群二维码
Skip to content

Netease Cloud Music API Enhanced Deployment

Netease Cloud Music API Enhanced Deployment ​

Based on NeteaseCloudMusicApiEnhanced/api-enhanced project.

Features ​

  • Song unlocking (ungraying)
  • Lossless audio (FLAC) support
  • Community-maintained

Requirements ​

  • Node.js 18+
  • pnpm is recommended for dependency management
MethodBest forEntry point
git cloneLong-running self-hosted deploymentgit clone https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
npxQuick trial runnpx @neteasecloudmusicapienhanced/api@latest
bunxOne-shot startup with Bunbunx @neteasecloudmusicapienhanced/api@latest
Docker ComposeLong-running container deploymentoven/bun:alpine + bunx @neteasecloudmusicapienhanced/api

::: note npx / bunx rely on the executable entry exported by the official npm package @neteasecloudmusicapienhanced/api. They download the package on first run, so git clone or Docker is still the better choice for persistent deployment. :::

Git Clone Deployment ​

1. Get the source code ​

shell
git clone https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
cd api-enhanced

2. Install dependencies ​

shell
pnpm install

3. Run ​

shell
node app.js

4. Customize port ​

Linux/macOS

shell
PORT=4000 node app.js

Windows

bat
set PORT=4000 && node app.js

NPX / Bunx Quick Start ​

Default port 3000

shell
npx @neteasecloudmusicapienhanced/api@latest
shell
bunx @neteasecloudmusicapienhanced/api@latest

Custom port

shell
PORT=4000 npx @neteasecloudmusicapienhanced/api@latest
shell
PORT=4000 bunx @neteasecloudmusicapienhanced/api@latest

Windows

bat
set PORT=4000 && npx @neteasecloudmusicapienhanced/api@latest
set PORT=4000 && bunx @neteasecloudmusicapienhanced/api@latest

Environment Variables ​

VariableDefaultDescription
CORS_ALLOW_ORIGIN*Allowed CORS origins. Multiple origins can be separated by commas.
ENABLE_PROXYfalseWhether to enable reverse proxy support.
PROXY_URLhttps://your-proxy-url.com/?proxy=Reverse proxy URL, only used when ENABLE_PROXY=true.
ENABLE_GENERAL_UNBLOCKtrueEnable global song unlocking
ENABLE_FLACtrueEnable lossless audio
SELECT_MAX_BRfalseSelect max bitrate when FLAC is enabled
FOLLOW_SOURCE_ORDERtrueMatch tracks strictly in source order.

Docker Compose ​

This setup runs bunx @neteasecloudmusicapienhanced/api directly inside a Bun base image, which keeps the container definition simple and easy to update.

yaml
services:
  ncm-api-enhanced:
    image: oven/bun:alpine
    container_name: ncm-api-enhanced
    restart: always
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "127.0.0.1:3003:3000"
    command: bunx @neteasecloudmusicapienhanced/api
    networks:
      - 1panel-network
    deploy:
      resources:
        limits:
          memory: 256M

networks:
  1panel-network:
    external: true

Start it with:

shell
docker compose up -d

If 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.