Building a Personal Music Website

📢 This article was translated by gemini-3-flash-preview

Use Rclone to mount OneDrive music files and Navidrome to build the website, both deployed using Docker.

Rclone

First, you need to run Rclone on Windows to get the configuration, then install and mount the files on your server.

Get Token

Download Rclone for Windows from: https://rclone.org/downloads/

Extract the files, open the folder in cmd, and run:

1
rclone.exe authorize "onedrive"

Log in and authorize in the browser window that pops up. Once finished, it will print a Token (the part between the curly braces, including the braces).

Get Configuration File

Run the command:

1
rclone.exe config

Follow the prompts to configure it. The configuration file is generated at:

1
C:\Users\%USERNAME%\AppData\Roaming\rclone

Copy Configuration File

First, create two folders on the server:

1
2
3
4
# For the configuration file
/home/docker/rclone/config
# For data (the OneDrive mapping folder)
/home/docker/rclone/data

Move your configuration file into the config folder.

Mount Directory

Run this command to pull the image:

1
docker pull rclone/rclone:latest

Mount the directory:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
docker run --rm \
    --volume /root/rclone/config:/config/rclone \
    --volume /root/rclone/data:/data:shared \
    --volume /etc/passwd:/etc/passwd:ro --volume /etc/group:/etc/group:ro \
    --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
    rclone/rclone \
    mount music:/ /data/music --allow-other --allow-non-empty --vfs-cache-mode writes &
# The last line above is the Rclone command; modify it as needed. Format:
rclone mount DriveName:Folder LocalFolder
# DriveName    The name you gave the Rclone mount
# Folder       The path on the cloud drive
# LocalFolder  The local mount point

The & at the end of the command runs it in the background. It will print the process PID. To stop it, use:

1
kill PID

Want to know more? See: Linux Study Chapter 6: Managing Running Processes

Following the example, this mounts the music directory from OneDrive to /home/docker/rclone/data/music.


References:


Deploying Navidrome

Using docker-compose. First, create a folder:

1
/home/docker/navidrome

Create a docker-compose.yml file and add the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
vim docker-compose.yml
# Enter content:
version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    ports:
      - "8001:4533"
    restart: unless-stopped
    environment:
      # Optional: put your config options customization here. Examples:
      ND_SCANSCHEDULE: 1h
      ND_LOGLEVEL: info  
      ND_SESSIONTIMEOUT: 24h
      ND_BASEURL: ""
    volumes:
      - "/home/docker/navidrome/data:/data"
      - "/home/docker/rclone/data/music:/music:ro"

Check more variables here: Navidrome Configuration Options - Navidrome

Then run:

1
docker-compose up -d

Access it via IP:8001.


References:


Song Metadata

To categorize your songs properly, you need to embed metadata (including lyrics) into the files.

You can use the tool MusicTag.

Author’s site: MusicTag PC Version

Other tools exist, such as this Web version: xhongc/music-tag-web

Using Clients

While the web interface works fine on PC, it’s not great on mobile. Fortunately, there are several compatible clients.

Details: https://www.navidrome.org/docs/overview/#apps

This post is licensed under CC BY-NC-SA 4.0 by the author.