Easily build Redmine on Windows using WSL2 and Docker

Introduction

Do you have a Redmine environment that you can use as you like?

Redmine cannot operate all functions and settings unless you have system administrator privileges. Also, in an environment with other users, it is not possible to change the settings as you like.

However, since Redmine is a server application, it requires some knowledge and effort to set it up. Also, many server applications, including Redmine, take more effort than Linux when trying to build on Windows. I think Linux is familiar to many IT engineers, but considering that Redmine is widely used by non-engineers, some people who want to use Redmine freely say "Linux". I imagine that there are many people who say "I don't understand" or "I only have a Windows PC at hand".

Therefore, in this article, I will explain the procedure for building a Linux environment using WSL2 (Windows Subsystem For Linux 2) on your Windows PC and building Redmine using Docker with less effort.

Notice

In this article, I will omit the explanation of WSL2 and Docker. (Although the explanation may be troublesome if it is confused ...) If the explanation of WSL2 and Docker is taken seriously, it will be a considerable amount. In this article, I hope that he will know that Redmine can be built easily and that everyone will feel free to try it, so I will proceed without touching on the theoretical part. I think that once you have an environment that actually works, you will feel like learning from it, so it would be better for him to study WSL2 and Docker from there. I think.

In addition, the content explained in this article is the information at the time of writing. Please be aware that the technology related to WSL2 and Docker is being updated rapidly, and this article may become obsolete soon. If the actual situation is different from this article, please refer to the primary information.

Operating environment

WSL2 requires a relatively new version of Windows 10 to work. Previously 2004 was required, but now it works with 1903/1909 as well. Also, previously it was only compatible with Windows 10 Pro, but now it is also available on Windows 10 Home.

WSL2 and Docker will work even if you don't have a lot of CPU or memory. However, the size of the Docker image is rather large, so it is better to reserve free disk space. (The image of Redmine handled this time alone has more than 500MB)

Construction procedure

The steps required to build are the following three steps.

  1. Install WSL2
  2. Install Docker Desktop
  3. Start Redmine container

WSL2 installation

See the Windows Subsystem for Linux Installation Guide for Windows 10 (https://docs.microsoft.com/ja-jp/windows/wsl/install-win10).

Since PowerShell commands are used in the procedure, it may seem a little hurdle for those who are not familiar with it, but you do not have to worry because you only need to execute the following commands in order.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Once this is done, all you have to do is install Linux. This time I will choose Ubuntu 20.04 LTS. This is the distribution of choice when running Docker.

Install Docker Desktop

See the "Installing Docker Desktop" chapter in "Overview of Docker Remote Containers in WSL 2" (https://docs.microsoft.com/ja-jp/windows/wsl/tutorials/wsl-containers). Beyond that, there's information for developers, but you can skip it all.

All you have to do is install Docker Desktop and change some settings.

Start Redmine container

It's a breather when you come here. It's a big deal, so let's try his Red Mica 1.2, which was just released the other day.

Start Ubuntu installed earlier and execute the following command, and it's OK.

sudo docker run -d -p 8000:3000 --name some-redmica redmica/redmica

If you go to http: // localhost: 8000, you will see Redmine. The initial user/password is both admin.

It ’s easy, is n’t it?

From here onward, please try various things while referring to the "Guide for System Administrators" in the Redmine Guide.

Note: About users who execute Docker commands

By default, Docker commands can only be executed by a superuser with root privileges (which in Windows is like administrator privileges). Ubuntu uses the command sudo to temporarily execute commands with superuser privileges.

By the way, the Docker command can be executed by the currently logged-in user. After running the following command, you can run the Docker command without sudo by logging back in to Ubuntu.

sudo usermod -aG docker (username created during Ubuntu setup)

For example, if the user name you created when setting up Ubuntu was alice, the actual command to execute would be:

sudo usermod -aG docker alice

Notes

The above steps are the minimum steps to start a Redmine container. In order to use it in earnest, it is necessary to make settings for persisting database information. For details on how to use it, refer to redmica/redmica on Docker Hub. It may be hard at first because you don't know what you're writing, but as you get used to Docker, you'll understand it.

Also, if you do not understand the nature of the Dokcer container correctly, you may have troubles such as losing the data that you intended to be persistent. However, it's not scary at all, and if you understand it correctly, it doesn't matter. It means that you may be in danger if you proceed without knowing it. It's a good idea to look into Dokcer containers and volumes around here. If you have any questions, you can ask me directly on Twitter etc.

Hot dima

I am making something called My favorite Redmine execution environment using Docker Compose. It also works on Ubuntu with WSL2 installed this time, so if you are interested, please try it.

in conclusion

With WSL2 and Docker, you can easily build Redmine. Not only Redmine but also many server applications can be easily built using Docker. It may be a good idea to use this as an opportunity to acquire Docker knowledge and improve your skills.

And I hope you all have a comfortable Redmine life.

Recommended Posts

Easily build Redmine on Windows using WSL2 and Docker
Using Docker on Windows10 Home WSL2
Try using Redmine on Mac docker
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
Windows Docker: Disk pressure on WSL files
Until you put Ubuntu 20 on Windows 10 Home and WSL2 and run Docker
Using JupyterLab + Java with WSL on Windows 10
Introducing Docker Desktop for Windows on WSL2
Build Redmine code reading environment on Docker
Redmine on Docker
Docker on Ubuntu18.04 on WSL2 and VSCode installation instructions
Operate Docker Desktop for Windows on Linux (WSL)
M.S. docker on Windows
Docker installation on WSL2
I built an Ubuntu environment on Windows 10 using WSL2.
I tried using Docker Desktop for Windows on Windows 10 Home
[Docker] Build an Apache container on EC2 using dockerfile
I installed CentOS 8 on Windows 10 using VirtualBox and Vagrant
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home
Install Docker on Windows 10 PRO
Run openvpn on Docker (windows)
Try Docker on Windows 10 Home
Manually build OpenJDK on Windows
Ubuntu on Windows build speed
Build docker environment with WSL
multi-project docker build using jib
[Amateur remarks] Build multiple WordPress on AWS using Docker Compose
How to create an environment that uses Docker (WSL2) and Vagrant (VirtualBox) together on Windows
Build Metabase with Docker on Lightsail and make it https with nginx
Install Docker and docker-compose on Raspberry Pi 4, Linux (Debian) and Windows 10, respectively
Use Docker Compose on Windows 10 Home
Easily handle war files on Windows
Build Clang x VSCode on Docker (1)
Try Docker on Windows Home (September 2020)
Build ffmpeg 4.3.1 on Ubuntu for Windows
Install Java 9 on windows 10 and CentOS 7
Build Unity development environment on docker
Easily try C # 9 (.NET 5) on Docker
Challenge to install WSL2 and docker
Installing and using Ansible on Ubuntu 16.04
Build Redmine on Azure App Service
How to build CloudStack using Docker
Install Docker on Ubuntu and set up remote connection using tls
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
How to build a Ruby on Rails environment using Docker (for Docker beginners)
Enable Docker build cache on GitHub Action and deploy to Amazon ECS
Installing Docker Desktop on Windows 10 Home was easy and easy (as of December 2020)
Upgrade and switch Ruby versions on Windows 10
Install docker and docker-compose on Alpine Linux
STS installation and Japanese localization on Windows 10
I tried running Docker on Windows Server 2019
Run NordVPN on Docker (Windows) Ubuntu container
Quick build maven project using maven docker container
Build an authentication proxy server using Docker
GPU recognition with docker using WSL2 (August 2020)
Try putting Docker in ubuntu on WSL
Build an environment with Docker on AWS
Build an Ultra96v2 development environment on Docker 1
Launched Redmine with Docker on Raspberry Pi 3
I installed WSL2 without using Microsoft Store and tried to build an environment where Docker can be used
Build a Doker-based development environment on Windows 10 Home 2020 ver. Part 1 Until WSL2-based Docker build