How to Install Wekan on Debian 9

In this tutorial, we will cover the steps needed for installing Wekan on a Debian 9 VPS.

Wekan is a free, flexible, and open-source Kanban Board. With Wekan, we can create boards and cards which can be moved between a number of columns. Wekan allows you to invite members to the board and assign tasks to a specific member. This maximizes productivity in a team because each member can see exactly how far along all tasks are, and focus on tasks based on their priority. The install process won’t take long, so let’s begin with the installation.

Prerequisites

  • For the purposes of this tutorial, we will use a Debian 9 VPS.
  • At least 1 GB of free RAM for Wekan. A production server should have a minimum total of 4 GB of RAM.
  • Full SSH access using the root account, or a user with sudo privileges is also required.

Step 1: Getting Started

Connect to your server via SSH as the root user using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Replace ‘root’ to a different account’s username if necessary.

Before starting with the installation, you will need to update your system packages to their latest versions.

You can do this by running the following command:

apt-get update 
apt-get upgrade

Step 2: Install Node.js

On Debian systems, you can install Node.js from the NodeSource repository:

$ apt-get update
$ apt install curl git gcc g++ make

After that, install the Node.js repository with the following command

$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

After that, run the commands below to install Node.js:

$ apt-get install nodejs

Step 3: Check the Node.js Version

After completing the installation, check and verify the installed version of Node.js and NPM. You can find more details about the current version on the Node.js official website.

$ node -v 

v12.2.0

Also, check the version of NPM.

$ npm -v 

6.9.0

If they are the versions shown above or newer, you can proceed with the next step.

Step 4: Install the MongoDB Database Server

MongoDB is the default database server for Wekan. Start the installation by importing the public key used by the package management system.

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

Add the MongoDB repository:

echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

Update the apt package index and install the MongoDB server:

$ apt-get update
$ apt-get install -y mongodb-org

Start the MongoDB service:

$ systemctl start mongod.service
$ systemctl enable mongod.service

Verify installation of MongoDB. You should have version 4.0 or later:

$ mongod --version
db version v4.0.9
git version: fc525e2d9b0e4bceff5c2201457e564362909765
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: debian92
    distarch: x86_64
    target_arch: x86_64

Step 5: Configure MongoDB

We need to configure the MongoDB authentication. We will log in to the mongo shell and create a new ‘admin’ superuser. Log in to MongoDB by running the following command:

mongo

Then switch to the DB admin and create a new admin user:

use admin

We will run the Mongo query below to create a new admin user with password and set the role as root.

db.createUser(
{
user: "admin",
pwd: "MyAdminPassword",
roles: [ { role: "root", db: "admin" } ]
}
)

Make sure to replace ‘MyAdminPassword‘ with a strong password.

The Admin user has now been created.

Restart the MongoDB service and the MongoDB authentication should be enabled.

systemctl restart mongod

We need to create a new database named ‘wekan’ with user ‘wekan’ with password ‘StrongPassword’. Change the password accordingly.

Login to the mongo shell as the admin user.

mongo -u admin -p

In the Mongo shell we will run the following queries:

use wekan
db.createUser(
{
user: "wekan",
pwd: "StrongPassword",
roles: ["readWrite"]
}
)

We successfully created a database and user for Wekan installation.

Step 6: Install Wekan

First, let’s create a wekan user so that root does not run your Wekan application.

$ adduser wekan --disabled-login --no-create-home

We will log in as the ‘wekan’ user.

$ su - wekan

We will download the latest version wekan source code using the wget command and extract it.

$ wget https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz
$ tar xf wekan-0.63.tar.gz

We also will make our new user own all of the Wekan install directories so that it can run them without any problems:

$ chown -R wekan:wekan /opt/bundle

We will go to that directory and install the Wekan dependencies using the ‘npm’ command.

$ cd /opt/bundle/programs/server
$ npm install

Now we will run the following commands to create the environment variables for the Wekan application.

$ export MONGO_URL='mongodb://wekan:StrongPassword@127.0.0.1:27017/wekan?authSource=wekan'
$ export ROOT_URL='http://your_ip_address/'
$ export MAIL_URL='smtp://user:pass@your_domain.com:25/'
$ export MAIL_FROM='wekan@your_domain.com'
$ export PORT=8000

We will go to the ‘bundle’ directory and run the Wekan Node.js application.

$ cd /opt/bundle
$ node main.js

Wekan has been successfully installed and it is listening on port 8000.

Step 7: Configure Wekan SystemD Service

You now have Wekan up and running, but it will stop running once you close the terminal session. To prevent this, we need to create a SystemD service so that it’s run by the system instead of the user.

Create a file named wekan.service in /etc/systemd/system/, using your preferred text editor:

$ cd /etc/systemd/system/
$ nano wekan.service

Paste the following content:

[Unit]
Description=Wekan Server
After=syslog.target
After=network.target

[Service]
Type=simple
Restart=always
StandardOutput=syslog
SyslogIdentifier=Wekan
User=wekan
Group=wekan
Environment=MONGO_URL=mongodb://127.0.0.1:27017/wekan
Environment=ROOT_URL=https://example.com
Environment=PORT=8000
Environment=MAIL_URL=smtp://user:pass@mailserver.example.com:25/
WorkingDirectory=/opt/bundle
ExecStart=/usr/bin/node /opt/bundle/main.js

[Install]
WantedBy=multi-user.target

Make sure to replace ‘example.com‘ with your registered domain name. Save and close the file.
To make the SystemD aware of this new file, run the following command:

$ systemctl daemon-reload

Start the Wekan service and enable it.

$ systemctl start wekan
$ systemctl enable wekan

Step 8: Access Wekan

Open your favorite web browser and type the URL http://your_ip_address:8000. We will be redirected to the Wekan log in page.

How to install Wekan on Debian 9
How to install Wekan on Debian 9

That’s it. If you followed all of the instructions properly, you should now be able to access your Wekan installation on your Debian 9 server.


Of course, you don’t have to install Wekan on Debian 9 if you have a Debian VPS with us. If you, you can install Wekan on your server by simply asking our support team to install Wekan on Debian 9 for you. They are available 24/7 and will be able to help you with the installation.

PS. If you enjoyed reading this blog post on how to install Wekan on Debian 9, feel free to share it on social networks using the share shortcuts, or simply leave a comment in the comments section. Thank you.

3 thoughts on “How to Install Wekan on Debian 9”

  1. Hi, tut ran smoothly on Debian Stretch (bunsenlabs) up to running: $ node main.js. I got the error: “there is an issue with node-fibers”… “fibers.node is missing”

    I tried running suggested:
    “/usr/bin/node /opt/bundle/programs/server/node-modules/fibers/build” (no quotes)

    but then got the following error:
    “stack Error: EACCES: permission denied, ‘mkdir /opt/build’ ” … “Ubuntu users please run: sudo apt-get install g++ build-essential” (no double quotes)

    which ran without error. I wonder if you can help me get over this problem so close to the finish line.

    Reply
    • Can you try and see the ownership of /opt/build directory? The error is related to the permissions of the /opt/build directory.

      Reply
      • The recursive ownership for `/opt/build` is wekan:wekan 755, but of course `/opt` is root:root 755. But I do think I also tried running the failed commands above with `sudo` but observed the same errors.

        Reply

Leave a Comment