Setting up your Spotify developer app
Each ghostlistener install uses its owner’s own Spotify developer app. You need two things from Spotify for Developers:
- the Client ID of an app you create, for signing in and reading what is playing, and
- a Soloist API key, for the silent player.
Both need a Spotify Premium account. Sign in to the dashboard with the account ghostlistener will play on.
Create the app
-
Open the dashboard and click Create app.
-
Fill in the form:
Field What to enter App name Anything, such as ghostlistener. Spotify shows it on the sign-in screen.App description Anything, such as Keeps my Spotify playing while I'm away.Website Leave it empty, or link your fork. Redirect URIs http://127.0.0.1:4467/callback, then click Add. See the redirect URI.APIs used Tick Web API. -
Accept the Developer Terms of Service and click Save.
-
On the app’s page, open Settings and copy the Client ID into
SPOTIFY_CLIENT_ID. ghostlistener signs in with PKCE, so it doesn’t use the client secret.
The redirect URI
Spotify sends you back to this address after you sign in, and it refuses any
address that isn’t listed in the app exactly as ghostlistener sends it. The
startup log prints the one ghostlistener uses (redirect_uri=...).
| How you reach the dashboard | Redirect URI to add |
|---|---|
| On the server itself, or through an SSH tunnel | http://127.0.0.1:4467/callback |
With GHOST_PORT set to another port |
http://127.0.0.1:<that port>/callback |
Through a domain, with GHOST_BASE_URL set |
<GHOST_BASE_URL>/callback, such as https://ghost.example.com/callback |
Spotify’s rules for redirect URIs:
http://only works for the loopback address127.0.0.1(or[::1]). Anything else needshttps://.localhostis not allowed. Use127.0.0.1.- The port and path must match exactly. You can list several URIs if you reach the dashboard more than one way.
Create the Soloist API key
- Open Spotify Soloist API Key in the same dashboard.
- Accept Spotify’s terms if it asks.
- Generate a key and copy it into
SOLOIST_API_KEYon thesoloistservice.
The key belongs to the account that made it. Don’t share it, and treat files and screenshots that contain it as private.
Find your username
GHOST_ALLOWED_USERS takes your Spotify user ID, which Spotify calls
Username. You’ll find it on your
account page. It is usually a mix of
letters and numbers, not your display name.
Playing on a different account
A new app runs in Development mode, where only the account that created it can sign in. If ghostlistener should play on another account, open the app’s User Management page and add that account’s name and email address.
ghostlistener plays for one account. The first account in GHOST_ALLOWED_USERS
to sign in becomes the linked one, and after that no other account can sign in.
Someone else who wants ghostlistener needs their own install and their own app.
If something goes wrong
| What you see | What to check |
|---|---|
Spotify says INVALID_CLIENT: Invalid redirect URI |
The redirect URI in the app doesn’t match the one in ghostlistener’s startup log. Copy it from the log. |
Spotify says INVALID_CLIENT: Invalid client |
SPOTIFY_CLIENT_ID has a typo, or the app was deleted. |
| ghostlistener refuses your account after sign-in | Your username isn’t in GHOST_ALLOWED_USERS, or another account already signed in first. The error page says which. |
The soloist container stops right after starting |
SOLOIST_API_KEY is missing or still the example value. docker compose logs soloist says which. |