Skip to content

Netease Cloud Music API Standard Deployment

Netease Cloud Music API Standard Deployment

Based on NeteaseCloudMusicApi project.

Requirements

MethodBest forEntry point
npm installPersistent deployment with pinned dependenciesnpm install NeteaseCloudMusicApi@latest
npxQuick trial runnpx NeteaseCloudMusicApi@latest
bunxOne-shot startup with Bunbunx NeteaseCloudMusicApi@latest
Docker ComposeLong-running container deploymentoven/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 -y

2. Install dependencies

shell
npm install NeteaseCloudMusicApi@latest

3. Run

shell
npx NeteaseCloudMusicApi

4. Customize port

Linux/macOS

shell
PORT=4000 npx NeteaseCloudMusicApi

Windows

bat
set PORT=4000 && npx NeteaseCloudMusicApi

NPX / Bunx Quick Start

Default port 3000

shell
npx NeteaseCloudMusicApi@latest
shell
bunx NeteaseCloudMusicApi@latest

Custom port

shell
PORT=4000 npx NeteaseCloudMusicApi@latest
shell
PORT=4000 bunx NeteaseCloudMusicApi@latest

Windows

bat
set PORT=4000 && npx NeteaseCloudMusicApi@latest
set PORT=4000 && bunx NeteaseCloudMusicApi@latest

Docker 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: 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.