Deploy Koel in one click
Your music library streamed to the browser and the phone apps, a personal Spotify
A self-hosted alternative to Spotify.
What is Koel?
Koel is an open-source music streaming server, a self-hosted Spotify alternative for the songs you own. Give it a folder of music files or drag them into the browser, and it sorts them into artists, albums and genres, with playlists and smart playlists. FLAC streams as it is, and formats browsers cannot play, such as AIFF and APE, are transcoded with FFmpeg. Songs can be cached in the browser for offline play, and podcasts and internet radio stations sit beside your music.
People run Koel so that a collection they bought or ripped plays anywhere, with no subscription. It suits one listener or a household: each person gets an account with private playlists and favorites. The catch is that in the free Community edition every account sees the same library, and a separate library per person needs Koel Plus, the paid edition.
Hosting Koel on Pethost
- You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
- New project opens at Koel. You fill in what it asks for and click Create project: Email, Admin password.
- In a minute or two Koel is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
- It is a project like any other: you or your agent can change it, roll it back or restore it.
Questions about Koel
Is Koel free and open source?
Yes. Koel is open source under the MIT license, and its Community edition is free. Koel Plus, a one-time purchase, adds cloud storage such as S3 or Dropbox, single sign-on, custom themes and an AI assistant.
Does Koel have a mobile app?
Yes. Koel Player is the official app for iOS and Android, a paid download that funds the project. Any Subsonic or OpenSubsonic client, such as Symfonium, Amperfy or substreamer, also works with your email and Subsonic API key.
Can Koel replace Spotify?
For music you own, yes: your files stream to the browser and to phone apps wherever you are. It has no catalogue of its own, so it plays only the songs you add.
What is the default Koel login?
The official Docker image creates [email protected] with the password KoelIsCool. This template changes that first admin to the email and password you enter when you deploy, so the default pair never works.
How do I add music to Koel?
Drag files into the web interface, or copy them into the music volume and click Save & Scan in Settings. For a large library, run php artisan koel:scan as www-data in the web terminal, since browser scans can time out.
How much memory and disk does Koel need?
Koel is light: about 150 MB with Postgres; the disk is your music, and a few hundred MP3 albums fit. On Pethost the Starter plan is enough for it, with room for other apps beside it.
Koel Docker Compose file
The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.
Containers: koel (phanan/koel:9.15.0), database (postgres:18.3-alpine).
Volumes, in the nightly backup: music, images, search, db.
services:
koel:
image: phanan/koel:9.15.0
restart: unless-stopped
environment:
APP_URL: ${URL}
FORCE_HTTPS: "true"
APP_DEBUG: "false"
APP_KEY: ${APP_KEY}
DB_CONNECTION: pgsql
DB_HOST: database
DB_PORT: 5432
DB_DATABASE: koel
DB_USERNAME: koel
DB_PASSWORD: ${DB_PASSWORD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
# The image initialises Koel only when a .env file exists, and koel:init makes the admin
# with a password everyone knows: the admin gets the email and the password given instead,
# while it still has that one.
entrypoint:
- sh
- -c
- |
cd /var/www/html
touch .env && chown www-data .env
runuser -u www-data -- koel-init
runuser -u www-data -- php -r '
require "vendor/autoload.php";
$$app = require "bootstrap/app.php";
$$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
$$admin = App\Models\User::where("email", App\Models\User::FIRST_ADMIN_EMAIL)->first();
if ($$admin && Illuminate\Support\Facades\Hash::check(App\Models\User::FIRST_ADMIN_PASSWORD, $$admin->password)) {
$$admin->email = getenv("ADMIN_EMAIL");
$$admin->password = Illuminate\Support\Facades\Hash::make(getenv("ADMIN_PASSWORD"));
$$admin->save();
}'
exec docker-php-entrypoint apache2-foreground
depends_on:
database:
condition: service_healthy
# The three folders the image declares as volumes.
volumes:
- music:/music
- images:/var/www/html/storage/app/public/images
- search:/var/www/html/storage/search-indexes
database:
image: postgres:18.3-alpine
restart: unless-stopped
environment:
POSTGRES_DB: koel
POSTGRES_USER: koel
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-U", "koel", "-d", "koel"]
interval: 5s
timeout: 5s
retries: 20
volumes:
music:
images:
search:
db:
More in Media
- OwncastLive video and chat on a page of your own
- NavidromeA music server that streams your own collection
- RomMA library and in-browser player for your retro games
- KomgaA server and web reader for your comics, manga and ebooks
- LycheeA photo gallery to upload, sort and share your photos
- AudiobookshelfYour own audiobook and podcast server: listen in the browser or the apps, with progress kept across devices