Skip to content

Instantly share code, notes, and snippets.

@dubrox
Created June 4, 2024 17:35
Show Gist options
  • Save dubrox/d35953ed95bedfa159c06ce197d81eec to your computer and use it in GitHub Desktop.
Save dubrox/d35953ed95bedfa159c06ce197d81eec to your computer and use it in GitHub Desktop.
How to install koha-testing-docker on Windows (revised)

This is a revised version of the official Koha wiki at the time of writing: https://wiki.koha-community.org/wiki/Koha-testing-docker#How_to_install_koha-testing-docker_on_Windows

How to install koha-testing-docker on Windows

Install/Activate Windows Subsystem for Linux (WSL)

  1. Open Powershell with admin privileges by pressing Win + X or through the app launcher.
  2. Type wsl --install and hit enter. This will install WSL and prompt you to choose a Linux distribution to install. You can choose Debian, either through the Microsoft Store or by typing wsl --install -d Debian.
  3. Set the default WSL version to 2 by typing wsl --set-default-version 2.
  4. (Optional) Install the new Windows Terminal which allows you to open a shell on your installed Linux distributions. You can install it from the Microsoft Store.

Create a new user with sudo access

  1. Open the WSL terminal by typing wsl
  2. Type sudo useradd $USER and replace $USER with the name of your choice.
  3. Add the new user to the sudo group by typing sudo usermod -aG sudo $USER.
  4. Create a user directory sudo mkdir /home/$USER
  5. Adjust the user directory owner sudo chown $USER:$USER /home/$USER
  6. Switch to the newly created user: su - $USER

Install Docker

  1. Follow the official guide to install Docker on Debian.
  2. Verify that everything is installed correctly by typing docker run hello-world.

Get necessary files to run the containers

  1. Create a new directory called git in your home directory by typing mkdir ~/git.
  2. Change to the new directory by typing cd ~/git.
  3. Clone the koha-testing-docker repository by typing git clone https://gitlab.com/koha-community/koha-testing-docker.git.
  4. Clone the Koha repository by typing git clone https://github.com/Koha-Community/Koha.git.
  5. Change the ownership of the koha-testing-docker and Koha directories to the new user by typing sudo chown -R $USER:$USER koha-testing-docker Koha.
  6. Copy the default .env file to a new file called .env by typing cp koha-testing-docker/env/defaults.env koha-testing-docker/.env.
  7. Edit the .env file by typing nano koha-testing-docker/.env and change the KOHA_IMAGE variable from main to main-bullseye.
  8. Save and exit by typing CTRL+X, then Y, then ENTER.

Run the container

  1. cd koha-testing-docker
  2. kdt up

If you followed the guide, you should have a running koha-testing-docker now and be able to access Koha on http://localhost:8080 for the OPAC or http://localhost:8081 for the staff client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment