In this tutorial, we will cover the steps needed for installing Wekan on an Ubuntu 18.04 VPS.
Wekan is a free, flexible and open-source Kanban Board application. 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 allows members of a team to collaborate more openly and know how the workload is being spread out across the team members. This improves productivity and gets more work done in less time. Installing it shouldn’t take long, so let’s get started.
Table of Contents
Requirements:
- For the purposes of this tutorial, we will use an Ubuntu 18.04 VPS.
- Full SSH root access or a user with sudo privileges is also required.
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.
Before starting with the installation you will need to update your system packages to their latest version.
You can do this by running the following command:
apt-get update apt-get upgrade
Step 1: Install Node.js
Before installing Node.js, we will add a new system user ‘wekan’. We need to install Node.js because Wekan is a Node.js-based application.
useradd -m -s /bin/bash wekan passwd wekan
We need to log in as the ‘wekan’ user and install Node.js.
su - wekan curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
Now we will install nvm
as the wekan user, after which we will add a new configuration in the .bashrc
configuration file.
source ~/.bashrc
We will test the nvm installation using the following commands:
command -v nvm nvm --version
To install Node.js, we have to run the commands shown below:
nvm install v4.8 nvm use node
The Node.js installation has been completed. To test and check the version, run the following command:
node -v
Step 2: Installing and Configuring MongoDB
In this step, we need to configure and install the MongoDB NoSQL database server. We need to add the MongoDB key and the repository to the system. This lets us install MongoDB through the package manager. Start by running the following commands:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
Now, we will update the repository and install MongoDB using the apt command.
sudo apt update sudo apt install mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools
MongoDB installation has been completed. We will start the MongoDB service and enable it.
sudo systemctl start mongod sudo systemctl enable mongod
We need to configure the MongoDB authentication. We will log in to the mongo shell and create a new ‘admin’ superuser.
mongo
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.
Now we will enable the authentication by editing the MongoDB configuration file, we’ll use nano, but you can use any text editor that you prefer.
nano /etc/mongod.conf
Find the ‘security’ line and edit the configuration:
security: authorization: enabled
Save and close.
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‘ Again, replace it to something stronger when you do this.
Log in 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 3: Install Wekan
First, we will log in as the ‘wekan’ user.
su - wekan
We will download the latest version of the wekan source code using the wget command before extracting it.
wget https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz tar xf wekan-0.63.tar.gz
It will download a new directory named ‘bundle’. We will go to that directory and install the Wekan dependencies using the npm
command.
cd bundle/programs/server npm install
Now, we will run the following commands to create the environment variables for 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
Make sure you replace all values in red with their respective values for your server.
We will go to the ‘bundle’ directory and run the Wekan Node.js application.
cd ~/bundle node main.js
Wekan has been successfully installed and it is listening on port 8000.
Step 4: Configure Wekan as a SystemD Service
We are already logged in as a wekan user and now we need to create a new environment variable file ‘.env’.
nano .env
Edit and paste the following information with your details.
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
Save and close.
Create a service file wekan.service in /etc/systemd/system
.
cd /etc/systemd/system/ vim wekan.service
Paste the following content:
[Unit] Description=Wekan Server After=syslog.target After=network.target [Service] Type=simple Restart=on-failure StartLimitInterval=86400 StartLimitBurst=5 RestartSec=10 ExecStart=/home/wekan/.nvm/versions/node/v4.8.7/bin/node bundle/main.js EnvironmentFile=/home/wekan/bundle/.env ExecReload=/bin/kill -USR1 $MAINPID RestartSec=10 User=wekan Group=wekan WorkingDirectory=/home/wekan StandardOutput=syslog StandardError=syslog SyslogIdentifier=Wekan [Install] WantedBy=multi-user.target
Save and close the file.
To make SystemD aware of it, run the following command:
systemctl daemon-reload
Finally, start the Wekan service and enable it.
systemctl start wekan systemctl enable wekan
Step 5: Access Wekan
Open your preferred web browser and type the URL http://your_ip_address:8000
. We will be redirected to the Wekan log in page. That’s it – you have successfully installed and configured Wekan for your Ubuntu 18.04 VPS.
Of course, you don’t have to install Wekan on Ubuntu 18.04 if you have an Ubuntu VPS with us. You can simply ask our support team to install Wekan on Ubuntu 18.04 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 Ubuntu 18.04, feel free to share it on social networks using the shortcuts below, or simply leave a comment in the comments section. Thank you.