Installation & setup
The Koha web installer returns a 500 error or times out
The installer dies partway through and the browser shows a 500 or a gateway timeout. Read the instance log to find out which step failed, then restart the install cleanly rather than retrying on a half-built database.
Updated 2026-08-12 · Tested against Koha 26.05
The web installer runs one long request per step, so a 500 or a gateway timeout means a step died or ran past Apache's limit — not that Koha is broken. Watch /var/log/koha/<instance>/intranet-error.log while you retry the step, raise Apache's Timeout if it is the long one, and only then consider starting the database again.
Retrying a failed step on a half-built database is the trap
- Find the real error first — it is in the log, not on the screen.
- If the schema step is the one that failed, drop and recreate the database rather than re-running over it.
- None of this applies once the installer has finished. On a live catalog, do not drop anything.
Step 1Find which step actually failed
$ sudo tail -f /var/log/koha/library/intranet-error.logLeave that running, then retry the installer step in the browser. The first new line is the fault. The generic 500 page carries no detail on purpose — reading the right log file covers what the common messages mean.
Step 2If it is a gateway timeout, give it longer
One or two steps — building the schema, loading the sample data — take minutes on a modest server. Apache gives up first and returns 504 while the step is still running underneath, which is why the timeout often "fixes itself" if you wait and reload.
Timeout 600$ sudo apache2ctl configtest$ sudo systemctl reload apache2Ten minutes is generous and temporary — put it back to the default (300) once the install is finished, because a long timeout on a live site keeps dead connections occupying workers.
Step 3If it cannot get past the database step
The installer asks for a database user and password. They are generated when the instance is created — not chosen by you, and not the MySQL root password:
$ sudo koha-passwd library koha_libraryS3cr3tGeneratedConfirm those credentials actually work before blaming the installer:
$ sudo koha-mysql library -e "SELECT DATABASE(), CURRENT_USER();" DATABASE() CURRENT_USER()koha_library koha_library@localhostIf that fails, the problem is the database, not Koha. The full explanation of where these credentials come from is in finding your Koha instance's admin password.
Restarting the install cleanly
When the schema step failed part-way, the supported reset is to remove the instance and create it again — it is a fresh install, so there is nothing to lose, and it is far more reliable than repairing a partial schema by hand.
$ sudo koha-remove library$ sudo koha-create --create-db librarykoha-remove deletes the instance and its database
sudo koha-list twice and make sure the name you are about to type is the empty instance.Then reload the staff URL and the installer starts again from the first step.
Why the installer is fragile in this one way
The web installer is an ordinary CGI script doing a very unordinary amount of work: it creates every table, loads the mandatory data, and on request loads sample records — all inside a single HTTP request, with a browser waiting. Anything with a request deadline in front of it (Apache's Timeout, a reverse proxy, a load balancer) will eventually decide the request is dead.
That also explains the shape of most reports: the failure appears on the same one or two steps for everybody, it is worse on small virtual machines, and it goes away on a server with faster disk. It is not a sign that the install is going wrong in some deeper way.
The other frequent cause has nothing to do with time. If the environment is wrong — no configuration path, a database the user cannot reach — the very first step 500s immediately rather than hanging. An instant failure and a slow one are different problems, and the log tells them apart in one line. Start there, and see Koha cannot locate koha-conf.xml if the message names the configuration file.
Would rather not do this yourself? We do it as a service — and if you would rather it were already done, it is on Koha Cloud before you log in.
Related
More on installation & setup
Answers to the questions that usually arrive with this one.
Koha cannot locate the configuration file koha-conf.xml
The error means the process has no KOHA_CONF set, not that the file is gone. Run the command through koha-shell, and here is how to confirm the file really is where Koha expects it.
Can you install Koha on Windows? (WSL2, VMs, and when not to)
There is no Windows build of Koha. You can run it on a Windows machine through WSL2 or a virtual machine — which is fine for evaluation and wrong for a live library.
Koha, Apache and port 8080: staff and OPAC on two hostnames
Koha serves two websites from one install. Here is how the OPAC and the staff interface are separated, why staff lands on port 8080, and how to move it off.
Finding your Koha instance’s admin password (koha-passwd)
The credentials the Koha web installer asks for are generated at install time and printed by koha-passwd. Here is how to find them, and how to reset a staff login.

