# Maloja

Maloja is a scrobble database. Every track you play gets recorded, and Maloja turns the pile into charts: top artists this week, top albums this year, how many hours went where, and a pulse graph of how much you have been listening lately.

It has been around a long time, which shows in the useful way. It accepts scrobbles in four different dialects, so clients that were written for Last.fm in 2007 work as well as ones written for ListenBrainz last month, and it gives you rules for fixing the metadata mess that a decade of ripped tags leaves behind.

[Get a 7-day trial of ElfHosted Maloja! 🪄](<https://store.elfhosted.com/product/maloja/>)

## How do I access Maloja?

Maloja is available:

- From your dashboard: [https://your-username.elfhosted.com](<https://your-username.elfhosted.com>)
- Directly: [https://your-username-maloja.elfhosted.com](<https://your-username-maloja.elfhosted.com>)

> [!NOTE]
>
> **Signed-in users see their own URLs**
>
> The addresses above show the general pattern. [Sign in](<https://docs-internal.elfhosted.com/app/maloja/>) and these become your personal, clickable links.

## Why would I want this?

- **Charts that go back as far as your data does.** Weekly, monthly and yearly, per artist, per album, per track.
- **It talks to almost anything.** Four scrobble APIs between them cover [Navidrome](</app/navidrome/>), phone players, browser extensions and desktop bridges.
- **Metadata rules.** Artists that show up under three spellings, remixers buried in the title, featured artists jammed into one tag: Maloja has rules for all of it, and applies them retroactively.
- **Your history stays yours.** One button gives you the whole database back as a file.

## First login

Maloja's admin password starts as `changemeelfie`. Change it from Maloja's own settings, and it sticks.

That is worth spelling out, because it is not how Maloja behaves everywhere else. Upstream only offers a setting that overwrites the password on every single startup, which would mean a password you chose reverting days later when your pod moves between machines. The ElfHosted image turns that into a proper first-run default: the password is seeded once, on the very first start, and left alone afterwards.

Your ElfHosted login already stands in front of the whole Maloja interface, so this password is a second lock on a door that is already locked. Changing it is still worth doing, because it is what protects your API key.

## Forgotten your Maloja password?

There is a way back in, and you do not need to raise a ticket for it. Set this with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Maloja's environment variables using ElfBot

```
MALOJA_FORCE_PASSWORD=<a new password of your choosing>
```

Restart Maloja and sign in with it. Then **unset that variable again** and restart once more, or Maloja will keep resetting your password to it on every startup and you will be back where you started.

## Getting your API key

Maloja generates an API key the first time it starts. Open the **admin** menu, then **API keys**, and copy the key from there. Every scrobble client authenticates with it, and it is the one credential worth guarding, because anyone holding it can write into your history.

## Scrobbling from Navidrome

[Navidrome](</app/navidrome/>) speaks ListenBrainz. Point it at Maloja with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Replace `<domain>` with the domain in your dashboard's address (*for example `elfhosted.com`*).

Quick-paste into Navidrome's environment variables using ElfBot

```
ND_LISTENBRAINZ_ENABLED=true
ND_LISTENBRAINZ_BASEURL=https://<your username>-maloja.<domain>/apis/listenbrainz
```

Then in Navidrome, open **Settings**, then **Personal**, turn on **Scrobble to ListenBrainz**, and paste in your Maloja API key when it asks for a token.

## Scrobbling from anything else

Maloja accepts four dialects. Pick whichever one your client already speaks, and use your Maloja API key wherever it asks for a password or a token. The username is ignored in every case.

| Your client speaks | Point it at |
| --- | --- |
| ListenBrainz | `https://<your username>-maloja.<domain>/apis/listenbrainz` |
| GNU FM / Gnukebox | `https://<your username>-maloja.<domain>/apis/audioscrobbler` |
| Audioscrobbler 1.2 | `https://<your username>-maloja.<domain>/apis/audioscrobbler_legacy` |
| Maloja's own API | `https://<your username>-maloja.<domain>/apis/mlj_1` |

Some clients want the base address, others want the full endpoint. If one refuses the address above, check which it is asking for.

Those scrobble endpoints are reachable without an ElfHosted login, because a phone cannot complete a browser sign-in. They are protected by your API key instead. The web interface, the admin pages and the export button all stay behind your ElfHosted login.

## Set your timezone

Maloja files each listen against a day server-side, so an unset timezone puts everything in UTC and your daily and weekly charts land on the wrong day. Set it with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Maloja's environment variables using ElfBot

```
MALOJA_LOCATION_TIMEZONE=Pacific/Auckland
MALOJA_WEEK_OFFSET=0
```

Use any [IANA timezone name](<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>). `MALOJA_WEEK_OFFSET` decides which day your week starts on, counting `0` as Sunday through to `6` as Saturday.

## Album art from Last.fm or Spotify

Maloja can fetch artwork from third-party services if you give it your own API credentials. Set them with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Maloja's environment variables using ElfBot

```
MALOJA_LASTFM_API_KEY=<your key>
MALOJA_SPOTIFY_API_ID=<your id>
MALOJA_SPOTIFY_API_SECRET=<your secret>
```

These are your credentials, not ours, and Maloja works perfectly well without any of them. It falls back to local images.

## Importing your history

Maloja reads import files from `import` inside its data folder, and picks them up when it next starts.

1. Get your export: [Last.fm via ghan.nl](<https://lastfm.ghan.nl/export/>), [Spotify](<https://www.spotify.com/us/account/privacy/>), [ListenBrainz](<https://listenbrainz.org/settings/export/>), or the export file from another Maloja instance.
2. Copy the file into `/storage/config/maloja/import/` using [FileBrowser](</app/filebrowser/>).
3. Restart Maloja from [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>).

## Getting your data back out

The **admin overview** page has an `Export` button under **Download Data**. It hands you the whole scrobble database as a single file, which imports cleanly into another Maloja instance or into [Koito](</app/koito/>).

## Maloja or Koito?

Both record the same thing. Maloja is the older and steadier of the two, accepts more scrobble dialects, and gives you far more control over metadata cleanup. [Koito](</app/koito/>) is the newer one, is faster once your history gets large, and has a much nicer interface.

If your music library has spent years accumulating inconsistent tags, Maloja's rules are the reason to pick it. If you mostly want to look at your listening, [Koito](</app/koito/>) is the better-looking answer. Both import from the other, so the choice is not permanent.

## Maloja also works with

- [x] [Navidrome](</app/navidrome/>)
- [x] [Lidarr](</app/lidarr/>)
- [x] [Koito](</app/koito/>)

## How do I get support for Maloja?

1. For general use of Maloja, refer to the [official site](<https://github.com/krateng/maloja>) or to one of the links in the resources section below.
2. For specific support re your ElfHosted configuration / account, see the [ElfHosted support options](</get-help/>)!

## Sponsor Maloja ❤️

You can contribute directly to the development of Maloja using the following:

- [Patreon](<https://www.patreon.com/krateng>)
- [PayPal](<https://paypal.me/krateng>)

## Maloja resources

- [Maloja (*official site*)](<https://github.com/krateng/maloja>)
