Install a self-hosted music server with Docker
Melarka runs as a single Docker container. You can install it with one command, or with a short docker-compose file if you like to see every step. Either way you end up with a server on port 4600 and an admin account.
What you need
- A Linux host (amd64 or arm64) with Docker and Docker Compose v2. A small home server or Raspberry Pi-class machine is enough for a household.
- A directory of music files in any format ffmpeg reads (FLAC, MP3, AAC/M4A, Ogg, Opus, WAV), or none: you can download from YouTube instead.
- For phones and the iPhone app: a domain name and an HTTPS reverse proxy.
The one-command install
curl -fsSL https://raw.githubusercontent.com/aaronsuns/melarka/main/deploy/install.sh | sh -s -- /path/to/your/music
The installer sets up a Docker Compose service in ~/melarka (or /srv/melarka when run as root), starts it, and prints the address and the admin password. Leave out the path and your music lives in ~/melarka/music; YouTube downloads go to ~/melarka/youtube. Read the script first if you like: it is deploy/install.sh.
Docker Compose, step by step
Save deploy/docker-compose.example.yml as docker-compose.yml, then in the same directory:
curl -fsSL -o config.yaml https://raw.githubusercontent.com/aaronsuns/melarka/main/deploy/config.example.yaml
printf 'MUSIC_DIR=%s\nLARK_ADMIN_PASSWORD=%s\n' /path/to/your/music "$(openssl rand -base64 18)" > .env
mkdir -p data youtube channels previews && sudo chown 1000:1000 data youtube channels previews
docker compose up -d
curl -fsS http://127.0.0.1:4600/api/v1/info
The container runs as uid 1000, not root, so the four directories must be owned by uid 1000 or the database cannot be written. Your music directory only needs to be readable. The image is ghcr.io/aaronsuns/melarka; pin a release with MELARKA_VERSION in .env.
First login and your family
- Open
http://127.0.0.1:4600on the server and sign in asadminwith the generated password (grep LARK_ADMIN_PASSWORD .env). - Change the password in Me, Change password.
- Add everyone under Admin, Users.
HTTPS for phones
The default listens on 127.0.0.1 only. For phones, put a reverse proxy in front. With Caddy, which gets the certificate itself, two lines are enough:
music.example.com {
reverse_proxy 127.0.0.1:4600 {
flush_interval -1
}
}
The README also has an nginx example with a login rate limit. The iPhone app requires HTTPS.
Backup and upgrade
Back up data/lark.db (use sqlite3 data/lark.db ".backup file.db" while it runs, since it uses WAL mode), plus channels/, youtube/, config.yaml and .env. Your own music directory is never changed. To upgrade, run the installer again or docker compose pull && docker compose up -d; database migrations run automatically.
Next: install the iPhone or Android app and read how a family uses it. Comparing options first? See Navidrome alternative.
Install in one command
Needs a Linux machine or NAS with Docker.
curl -fsSL https://raw.githubusercontent.com/aaronsuns/melarka/main/deploy/install.sh | sh -s -- /path/to/your/music
Install in one command ★ Melarka on GitHub
Step by step and configuration: docs/install.md.
FAQ
Does Melarka run on a Raspberry Pi?
The Docker image is published for linux/amd64 and linux/arm64, and a small home server or Raspberry Pi-class machine is enough for a household.
Can I use it without HTTPS?
On the server and your home network, yes, over plain HTTP. Phones outside the house and the iPhone app need an HTTPS address.
Does it change my music folder?
No. It only reads it. If you want deleting a song to move the file into a .lark-trash folder, the folder must be writable by uid 1000.
How do I upgrade?
Back up, then run the installer again, or docker compose pull and docker compose up -d.