install-wekan-on-an-ubuntu-14-04-vpsIn this blog post we will show you how to install Wekan on an Ubuntu 14.04 VPS with the latest version of Nginx as a reverse proxy. Wekan is an open-source Trello-like kanban board application which runs on Node.js and MongoDB. This guide should work on other Linux VPS systems as well, but was tested and written for Ubuntu 14.04 VPS.

Log in to your VPS via SSH

ssh [email protected]_IP

Update the system and install necessary packages

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install software-properties-common libssl-dev curl build-essential nano

Install Node.js

We will install the nodejs version 0.10.40 using the nvm (Node Version Manager) script

[user]$ curl -o- | bash
[user]$ source ~/.nvm/
[user]$ nvm install v0.10.40
[user]$ nvm use v0.10.40
[user]$ nvm alias default v0.10.40

Install MongoDB

To install the latest MongoDB package from the official MongoDB repository run the following commands:

[user]$ sudo apt-key adv --keyserver --recv 7F0CEB10
[user]$ echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
[user]$ sudo apt-get update
[user]$ sudo apt-get install -y mongodb-org

Download and install Wekan

Create a root directory for your Wekan instance and download the latest release from github using the following commands:

[user]$ mkdir -p ~/wekan
[user]$ curl -LOk
[user]$ tar xzvf wekan-0.10.1.tar.gz -C ~/wekan
[user]$ cd ~/wekan/bundle/programs/server
[user]$ npm install 

In case you never heard of Forever, it is a tool which ensures that a given script runs forever.

[user]$ npm install forever -g

Create an Upstart script

[user]$ sudo nano /etc/init/wekan.conf

description "Wekan Upstart Script"
start on startup
stop on shutdown
expect fork

env NAME="Wekan"
env NODE_PATH="/home/username/.nvm/v0.10.40/bin"
env APPLICATION_PATH="/home/username/wekan/bundle/main.js"
env PIDFILE=/var/run/
env LOGFILE=/var/log/wekan.log
env MONGO_URL="mongodb://"
env ROOT_URL=""
env MAIL_URL='smtp://user:[email protected]:25/'
env PORT="8080"


    exec forever \
        --pidFile $PIDFILE \
        -a \
        -l $LOGFILE \
        --minUptime 5000 \
        --spinSleepTime 2000 \
        start $APPLICATION_PATH

end script
pre-stop script

    exec forever stop $APPLICATION_PATH
end script

Do not forget to change username with your actual username.

You can now start your Wekan service with :

[user]$ sudo service wekan start

Install and Configure Nginx

The latest version of Nginx 1.8 is not available via the default Ubuntu repositories, so we will add the “nginx/stable” PPA, update the system and install the nginx package.

[user]$ sudo add-apt-repository ppa:nginx/stable
[user]$ sudo apt-get update
[user]$ sudo apt-get install nginx

Create a new Nginx server block with the following content

[user]$ sudo nano /etc/nginx/sites-available/wekan
server {
    server_name my_wekan_domain;
    listen 80;

    access_log /var/log/nginx/wekan-access.log;
    error_log /var/log/nginx/wekan-error.log;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $host;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection 'upgrade';
        proxy_cache_bypass $http_upgrade;

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/wekan /etc/nginx/sites-enabled/wekan

Test the Nginx configuration and restart the server

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

That’s it. You can now open your browser, type the address of your Wekan instance and register your first user.

For more information about how manage your Wekan application, please refer to the Wekan website.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.