Self-hosted service
tranxuanthang/lrclib avatar
tranxuanthang/lrclib

LRCLIB server: a Rust and Axum rewrite of lrclib.net that keeps everything in one SQLite file

LRCLIB server written in Rust with Axum and SQLite3 database

2,322 stars92 forksRustMIT

At a glance

What is it?
The open-source server behind a free synchronized-lyrics service. Setup is two cargo commands or one container, and the tuning knobs are all about how much of the SQLite file you let into RAM.
Who is it for?
Run this if you want your own copy of the lrclib.net server code, with a single SQLite file as the whole data store and a Podman or Docker image that already exists. Skip it if you expected a lyrics database to come with the code, because the repository documents none.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 22 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 28, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • tranxuanthang/lrclib2,322 ★ · +182
Star history
Repository2026-10-192026-11-28
tranxuanthang/lrclib2.1k2.3k

182 Stars in the last 40 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A from-scratch Rust rewrite of the lrclib.net source

The repository holds the source of lrclib.net, rewritten in Rust from scratch. The stack is Axum for HTTP and SQLite3 for storage. lrclib.net itself is described as a completely free service for finding and contributing synchronized lyrics, with an easy-to-use and machine-friendly API.

The workspace is small. The root Cargo.toml defines a package named lrclib at version 0.1.0, edition 2021, and pulls in anyhow, clap with the derive and env features, and tokio with the full feature set. A single workspace member, server, holds the rest of the code. The top level also carries a Dockerfile, an ARCHITECTURE.md and an AGENTS.md.

The last push to the repository was on 15 October 2026. There are no GitHub releases, so there is no tagged binary to download. You build it yourself, or build the container image from the Dockerfile. The version string 0.1.0 in Cargo.toml.

Two cargo commands bring the server up on port 3300

The native route needs a Rust toolchain and nothing else spelled out in the README. First build the release binary:

code
cargo build --release

Then run the server against a database file:

code
LRCLIB_LOG=info cargo run --release -- serve --database db.sqlite3

The server listens at http://0.0.0.0:3300. LRCLIB_LOG sets the log level, and the example uses info. The serve subcommand takes --database for the SQLite path. The Dockerfile also passes --port 3300, which shows that the port is a flag and not a constant.

The address 0.0.0.0 means the server accepts connections on every interface. The README gives no authentication or TLS setup, so anything that should not be public needs a proxy or firewall that you put in front of it.

LRCLIB_MMAP_SIZE defaults to 30GB and can push a small machine into swap

Three environment variables control the SQLite connection. LRCLIB_MMAP_SIZE defaults to 30000000000, which is 30GB, and sets SQLite's mmap_size parameter. The README advises keeping it below 75% of the available RAM and warns that an excessive value can cause memory swapping and lower performance.

LRCLIB_CACHE_SIZE defaults to -1000000, which is 1GB, because negative values are read as kilobytes. It sets SQLite's cache_size. LRCLIB_POOL_MAX_SIZE defaults to 16 and caps the number of connections the r2d2 pool manages. It must be a positive integer.

The README says the defaults are generously sized for a production system and that you should lower them for low traffic or low memory. A 30GB mmap default on a small VPS is the failure to watch for. The Dockerfile sets CFLAGS to -DSQLITE_MAX_MMAP_SIZE=0x4000000000 while compiling, so the build itself allows far larger mappings than the runtime default asks for.

The container image builds on rust:1.91-alpine3.22 and stores data in /data

The Dockerfile is a two-stage build. The builder stage starts from docker.io/rust:1.91-alpine3.22, installs alpine-sdk, and runs cargo build --release --workspace --locked with cache mounts for the cargo registry, git checkouts and the target directory. The final stage is alpine:3.22 with sqlite installed, the lrclib binary copied to /usr/local/bin, and an empty /data directory. It exposes port 3300 and starts with the serve command pointed at /data/db.sqlite3.

The README's Podman commands match that layout. Build the image:

code
podman build -t lrclib-oss:latest -f Dockerfile .

Run it with a named volume for the data:

code
podman run --rm -it -d -v lrclib-data:/data -p 3300:3300 -e LRCLIB_LOG=info --name lrclib-oss lrclib-oss:latest

Because the database lives in the lrclib-data volume, removing the container keeps the file. The README states the Docker route as an alternative to Podman, with the same Dockerfile.

The sqlite3 binary in the image doubles as the admin console

The runtime image installs sqlite, and the README uses that to give you a shell onto the live database:

code
podman run --rm -it -v lrclib-data:/data lrclib-oss:latest sqlite3 /data/db.sqlite3

This mounts the same lrclib-data volume into a throwaway container and opens the file with the sqlite3 command line. There is no admin API in the README, so backups, inspection and manual edits go through this route or through any SQLite tooling pointed at the file.

The cost of that design is that the server and the shell share one file. The README does not say whether running the shell while the server is up is safe for writes, so treat the console as read-only unless you have stopped the service. It also does not document the table layout, so you would have to read the schema from the file or from the server code.

Quadlet turns the container into a systemd user service

For a machine that should keep the server running, the README uses Quadlet. You create lrclib.container under ~/.config/containers/systemd/. The example file sets Image=lrclib-oss:latest, PublishPort=3300:3300, Volume=lrclib-data:/data, ContainerName=lrclib-oss and Environment=LRCLIB_LOG=info. The Service section has Restart=always and the Install section targets multi-user.target and default.target.

The lifecycle then runs through systemctl in user mode. Reload with systemctl --user daemon-reload, start with systemctl --user start lrclib.service, check with systemctl --user status lrclib.service, and pick up a rebuilt image with systemctl --user restart lrclib.service.

That last step is the update procedure. You rebuild lrclib-oss:latest from the Dockerfile and restart the unit. The README mentions no migration step, so whether the SQLite schema changes between commits is not something you can learn from the documentation.

The repository ships the server and no lyrics, client or API reference

Anyone searching for how to use the LRCLIB API will not find endpoint documentation in the README. It says the service has a machine-friendly API and stops there. The README has no route list, request format or authentication scheme. ARCHITECTURE.md exists at the top level and is the place to look for the design.

The README also does not say how a fresh server gets lyrics. After the first run, db.sqlite3 is a database you populate yourself. Nothing in the README points to a dump of lrclib.net's data, and the free service at lrclib.net is a separate thing from the code.

The README's closing sections cover donations through GitHub Sponsors and other channels, and an email contact. For a self-hoster the practical reading is that you get the server and a deployment recipe, and you have to bring your own data and your own client.

Editorial conclusion

Run this if you want your own copy of the lrclib.net server code, with a single SQLite file as the whole data store and a Podman or Docker image that already exists. Skip it if you expected a lyrics database to come with the code, because the repository documents none. Before you size a machine, set LRCLIB_MMAP_SIZE and LRCLIB_CACHE_SIZE yourself, since the defaults assume 30GB of mapped file and 1GB of cache.

Frequently asked questions

What programming language is LRCLIB in?

The server is written in Rust, using Axum for HTTP and a SQLite3 database. Cargo.toml defines the workspace and the Dockerfile builds it with rust:1.91-alpine3.22.

How do I use LRCLIB on my own machine?

Run cargo build --release, then start the server with serve --database db.sqlite3. It listens at http://0.0.0.0:3300. A Podman or Docker image can be built from the Dockerfile instead.

Is LRCLIB free?

The README describes lrclib.net as a completely free service for finding and contributing synchronized lyrics. The server code is MIT licensed.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. tranxuanthang/lrclib on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tranxuanthang-lrclib.svg)](https://hysenlabs.com/projects/tranxuanthang-lrclib)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/tranxuanthang-lrclib.svg)](https://hysenlabs.com/projects/tranxuanthang-lrclib)

Was this useful?