[GH-ISSUE #1303] Web UI port via .env and MySQL UNIX socket #752

Closed
opened 2026-02-26 02:34:10 +03:00 by kerem · 3 comments
Owner

Originally created by @MichaIng on GitHub (Apr 5, 2021).
Original GitHub issue: https://github.com/koel/koel/issues/1303

I have two questions and will create commits and a PR for the docs, once answered:

  1. I haven't overseen something that the default web UI listening port cannot be changed via .env file, but only via --port command option, right? Would be worth a request as well, so that e.g. service files do not need to be touched to change it. Otherwise it would be a good hint for the docs, where the default port 8000 is mentioned.
  2. Is it possible to connect to the database via UNIX socket? Often, in case of MySQL, this is possible by using port "0", sometimes by using host "localhost". Probably it has been implemented via some library and in case would be reasonable to add to the docs or even as default, to get the little performance benefit + security benefit when MySQL can hence run without listening on any network port.
Originally created by @MichaIng on GitHub (Apr 5, 2021). Original GitHub issue: https://github.com/koel/koel/issues/1303 I have two questions and will create commits and a PR for the docs, once answered: 1. I haven't overseen something that the default web UI listening port cannot be changed via `.env` file, but only via `--port` command option, right? Would be worth a request as well, so that e.g. service files do not need to be touched to change it. Otherwise it would be a good hint for the docs, where the default port **8000** is mentioned. 2. Is it possible to connect to the database via UNIX socket? Often, in case of MySQL, this is possible by using port "0", sometimes by using host "localhost". Probably it has been implemented via some library and in case would be reasonable to add to the docs or even as default, to get the little performance benefit + security benefit when MySQL can hence run without listening on any network port.
kerem closed this issue 2026-02-26 02:34:10 +03:00
Author
Owner

@MichaIng commented on GitHub (Apr 8, 2021):

  1. DB_HOST=localhost does the trick to connect via UNIX socket to MariaDB in my case, while DB_PORT then has no effect. I'm wondering how it knows the socket path, as I didn't provide it anywhere. Probably the PHP MySQL module has some default paths compiled in? However ss -tulp shows no MariaDB process but I can successfully update the library and change user details in Koel web UI and can see the changes reflected in the MariaDB console.
<!-- gh-comment-id:816026855 --> @MichaIng commented on GitHub (Apr 8, 2021): 2. `DB_HOST=localhost` does the trick to connect via UNIX socket to MariaDB in my case, while `DB_PORT` then has no effect. I'm wondering how it knows the socket path, as I didn't provide it anywhere. Probably the PHP MySQL module has some default paths compiled in? However `ss -tulp` shows no MariaDB process but I can successfully update the library and change user details in Koel web UI and can see the changes reflected in the MariaDB console.
Author
Owner

@phanan commented on GitHub (Apr 11, 2021):

@MichaIng You can find the answers to your questions in Laravel's doc. I guess one thing can be put into Koel's doc is that one can refer to Laravel's doc for more configuration information, to which I can appreciate a PR.

<!-- gh-comment-id:817347525 --> @phanan commented on GitHub (Apr 11, 2021): @MichaIng You can find the answers to your questions in [Laravel's doc](https://laravel.com/docs/8.x/database#configuration). I guess one thing can be put into Koel's doc is that one can refer to Laravel's doc for more configuration information, to which I can appreciate a PR.
Author
Owner

@MichaIng commented on GitHub (Apr 11, 2021):

Generally good to know about the Laravel docs, but actually I couldn't find any hint about defining a listening port or connection to MySQL via UNIX socket via .env file in the Laravel docs, generally no list of available environment variables.

While a general hint about this in the docs is a good idea, it wouldn't hurt to have the most important things directly available in the Koel docs. At least the listening port, I'd say, is essential. The CLI has help commands, but for .env file based configuration, finding further information (aside of what is present in the example .env) is not trivial.

<!-- gh-comment-id:817352517 --> @MichaIng commented on GitHub (Apr 11, 2021): Generally good to know about the Laravel docs, but actually I couldn't find any hint about defining a listening port or connection to MySQL via UNIX socket via `.env` file in the Laravel docs, generally no list of available environment variables. While a general hint about this in the docs is a good idea, it wouldn't hurt to have the most important things directly available in the Koel docs. At least the listening port, I'd say, is essential. The CLI has help commands, but for `.env` file based configuration, finding further information (aside of what is present in the example `.env`) is not trivial.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#752
No description provided.