
如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This image will no longer receive updates. Latest versions are now pushed to https://hub.docker.com/r/phanan/koel. Please switch to phanan/koel:latest and sorry for the inconvenience.
A docker image with only the bare essentials needed to run koel. It includes apache and a php runtime with required extensions.
See the Changelog to keep track of changes to the image.
⚠ This container does not include a database. It requires another container to handle the database.
Since Koel supports many databases you are free to choose any Docker image that hosts one of those databases.
koel/docker (this image) has been tested with MySQL and PostgreSQL.
docker-compose is the easiest way to get started. It will start both the database container and this image.
Clone this repository and edit docker-compose.mysql.yml. Make sure to replace passwords !
Check out the ./docker-compose.mysql.yml file for more details.
Then run docker-compose:
bashdocker-compose -f ./docker-compose.mysql.yml up -d
Clone this repository and edit docker-compose.postgres.yml. Make sure to replace passwords !
Check out the ./docker-compose.postgres.yml file for more details.
Then run docker-compose:
bashdocker-compose -f ./docker-compose.postgres.yml up -d
On the first run, you will need to:
APP_KEYAll these steps are achieved by running koel:init once:
Replace <container_name_for_koel> in the command by the actual container name.
bashdocker exec -it <container_name_for_koel> bash # Once inside the container, you can run commands: $ php artisan koel:init --no-assets
--no-assets option tells the init command to skip the build of front-end assets. They are already built by a Github Action in koel's repository, so this step is not necessary.
⚠ From v5.1.0, Koel will no longer ask for a username, email and password for the admin account. Instead, it creates one automatically with the following credentials:
email: admin@koel.dev password: KoelIsCool
Make sure to change this unsecure password with the user interface (click on your profile picture) or by running the following command:
bashdocker exec -it <container_name_for_koel> php artisan koel:admin:change-password
Create a docker network. It will be shared by Koel and its database.
bashdocker network create --attachable koel-net
Create a database container. Here we will use https://hub.docker.com/r/mysql/mysql-server.
bashdocker run -d --name database \ -e MYSQL_ROOT_PASSWORD=<root_password> \ -e MYSQL_DATABASE=koel \ -e MYSQL_USER=koel \ -e MYSQL_PASSWORD=<koel_password> \ --network=koel-net \ -v koel_db:/var/lib/mysql \ mysql/mysql-server:5.7
Create the koel container on the same network so they can communicate
bashdocker run -d --name koel \ -p 80:80 \ -e DB_CONNECTION=mysql \ -e DB_HOST=database \ -e DB_DATABASE=koel \ -e DB_USERNAME=koel \ -e DB_PASSWORD=<koel_password> \ --network=koel-net \ -v music:/music \ -v covers:/var/www/html/public/img/covers \ -v search_index:/var/www/html/storage/search-indexes \ hyzual/koel
The same applies for the first run. See the First run section.
.env fileTo be sure to preserve APP_KEY you can choose to bind-mount the .env file to your host:
bash# On your host, create an `.env` file: touch .env # Then, you can bind-mount it directly in the container. docker run -d --name koel \ -p 80:80 \ --mount type=bind,source="$(pwd)"/.env,target=/var/www/html/.env \ hyzual/koel docker exec -it koel bash # In the container, init $ php artisan koel:init --no-assets
Once you have generated an APP_KEY you can provide it as environment variables to your container to preserve it.
bash# Run a container just to generate the key docker run -it --rm hyzual/koel bash # In the container, generate APP_KEY $ php artisan key:generate --force # Show the modified .env file $ cat .env # Copy the APP_KEY variable $ exit
You can then provide the variables to your real container:
bashdocker run -d --name koel \ -p 80:80 \ -e APP_KEY=<your_app_key> \ hyzual/koel # Even better, write an env-file in your host and pass it to the container docker run -d --name koel \ -p 80:80 \ --env-file .koel.env \ hyzual/koel
Whenever the music in /music changes, you will need to manually scan it before koel is able to play it. Run the following command:
bashdocker exec <container_name_for_koel> php artisan koel:sync
If you were running a version of Koel prior to v5.0.2, the search mechanism has changed and needs a step to index songs, albums and artists. Run the following command:
bashdocker exec <container_name_for_koel> php artisan koel:search:import
For all new songs, the search index will be automatically populated by php artisan koel:sync. No need to run the php artisan koel:search:import again 🙂.
See https://github.com/koel/koel/blob/v5.1.3/.env.example for reference.
DB_CONNECTION: mysql OR pgsql OR sqlsrv OR sqlite-persistent. Corresponds to the type of database being used with Koel.DB_HOST: database. The name of the Docker container hosting the database. Koel needs to be on the same Docker network to find the database by its name.DB_USERNAME: koel. If you change it, also change it in the database container.DB_PASSWORD: The password credential matching DB_USERNAME. If you change it, also change it in the database.DB_DATABASE: koel. The database name for Koel. If you change it, also change it in the database.APP_KEY: a base64 string. It is generated by php artisan koel:init or by php artisan key:generate. Once you have scanned music, DO NOT CHANGE APP_KEY. Songs are identified by a combination of APP_KEY and their path, so if APP_KEY changes, the next php artisan koel:scan will report all songs as changed.FORCE_HTTPS: if set to true, all URLs redirects done by koel will use https. If you have setup a reverse-proxy in front of this container that supports https, set it to true.MEMORY_LIMIT: amount of memory in MB for the scanning process. Set this if php artisan koel:scan runs out of memory.LASTFM_API_KEY and LASTFM_API_SECRET: Enable scrobbling to Last.fm. See [***]/music will contain the music library. Keep in mind that koel needs to scan music before it's able to play it.
/var/www/html/storage/search-indexes will contain the search indexes. Searching songs, albums and artists leverages this to provide results.
Only HTTP is provided. *** setting up a reverse-proxy to provide HTTPS support.
Apache's root directory. All koel files will be here. If you exec into the container, this will be your current directory.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务