Maloja – A Free and Lightweight Alternative to Last.fm

If you’re an avid music listener, you might have wondered how your music tastes and listening habits changed over time. Maloja is a lightweight, open-source music scrobbler for your homelab. It comes with powerful features that offer flexibility while removing the unnecessary cruft that comes with other alternative services.

Features

  • Ultra-lightweight and doesn’t rely on third-party services
  • Highly customizable with the ability to select custom images
  • Supports custom tagging schemas for your music database
  • Supports granular associations with artists and releases
  • Comes with the ability to sort based on featured artists
  • Supports manual and proxy scrobbling for third-party services
  • Comes with an easy-to-understand API for better integration

Installation

The fastest way to install Maloja is by deploying it as a Docker container on your homelab. To do that, first install Docker and Docker Compose on your server.

Create a new folder on your homelab user’s home directory and navigate inside it:

mkdir ~/maloja && cd ~/maloja

Create a new docker-compose.yml file inside the Maloja directory:

nano ./docker-compose.yml

Paste the following block of code inside the Compose file:

services:
maloja
:
image
: "krateng/maloja:latest"
environment
:
PUID
: "1000"
PGID
: "1001"
ports
:
- "42010:42010"
volumes
:
- "./config:/etc/maloja"
- "./data:/var/lib/maloja"
- "./logs:/var/log/maloja"

Create the necessary subdirectories, then start the Docker installation process:

mkdir ./{config,data,logs}
docker compose up -d

Once done, fetch the randomly generated password for your instance by running the following command:

docker compose logs | grep "Generated password:"
A terminal highlighting the randomly generated password for Maloja.

Lastly, confirm that the Maloja container is working properly by checking the active Docker processes on your system:

docker ps

Usage

To access your Maloja instance, open a web browser session and navigate to your homelab’s IP address followed by “:42010.”

A screenshot showing my homelab IP address followed by Maloja's port.

Click the Gear icon on the page’s upper right corner.

A screenshot highlighting the Gear icon on the Maloja landing page.

Provide the randomly generated password that you got from the Docker container, then press Log-in.

Once done, the server will redirect you to the Overview page of its admin console. Here, you can update your current Maloja instance, enable “Admin Mode,” and export your scrobbling data.

A screenshot showing the Overview page of the Maloja admin panel.

The Server Setup category goes through some reminders on how to set up scrobbling for popular music platforms. It’s also where you can add custom rules that tweak Maloja’s default behavior.

A screenshot showing the Server Setup screen for Maloja.

The Settings category exposes some of the instance’s common variables. For example, you can set the location of the system directories, input the API keys from other scrobblers, and customize how your main page looks.

A screenshot showing the Settings screen in Maloja.

Finally, the API Keys category lists all the active keys for your Maloja instance. You can also generate a new API key here if you want to link an external tool to Maloja.

Linking Maloja to an Online Music Player

To start scrobbling on your web browser, first download web-based music scrobbler extension. Since I’m using Chromium, I’ve opted to install Web Scrobbler from the Chrome Web store.

A screenshot showing the Chrome Web Store page for the Web Scrobbler extension.

Navigate to your Maloja Admin Console, then click API Keys.

Provide a name for your new API key under the Identifier text box, then click New Key.

A screenshot highlighting the process of creating a new API key in Maloja.

Note: the developers of Maloja strongly suggest generating a new API key whenever you link a new service or tool to the instance.

Copy the API key to your clipboard, then open the Web Scrobbler extension panel.

Click the Gear icon to open the extension’s settings page.

A screenshot highlighting the Gear icon on the Web Scrobbler extension screen.

Select the Accounts category, then scroll down to the Maloja section.

Paste the following line of code on the API URL textbox, replacing the “YOUR-HOMELAB-URL” with the IP address of your homelab:

http://YOUR-HOMELAB-URL:42010/apis/mlj_1/newscrobble

Paste your Maloja instance’s API key on the Token textbox, then click Save.

A screenshot highlighting the Maloja section in the Web Scrobbler settings.

Confirm that the scrobbler is working properly by playing music from an online service, then checking the Maloja page.

A screenshot showing Maloja scrobbling music properly.

Final Thoughts

Maloja is a lightweight and highly flexible music scrobbler for Docker-based home labs. In addition to scrobbling, it offers additional features that allow you to tweak and customize your experience.

Further, Maloja has tools that make it easy to migrate from an existing scrobbling system. As such, I fully recommend Maloja if you’re looking for a scrobbling server that’s easy to deploy and use. Alternatively, if you want to broadcast music from your server, check out our review of the AzuraCast internet radio server.

Be the first to comment! Get the discussion going.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.