You've successfully subscribed to MyPad Blog
Great! Next, complete checkout for full access to MyPad Blog
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Setting up Kutt on running Ubuntu

Setting up Kutt on running Ubuntu

Setting up Kutt on running Ubuntu

It is sometime cool to have a tiny url customized the way you want without burning a hole in your pocket! Kutt helps with that!

And yeah ... this post is going to be available at :-)

Install Postgres

Follow instructions mentioned here

# Step 1 — Installing PostgreSQL

sudo apt update
sudo apt install postgresql postgresql-contrib

# Switch over to the postgres account on your server by typing:
sudo -i -u postgres

# You can now access a Postgres prompt immediately by typing:

# Exit out of the PostgreSQL prompt by typing:

# Step 3 — Creating a New Role

sudo -u postgres createuser --interactive

# i created a user called psql_ghost

# Step 4 — Creating a New Database
sudo -u postgres createdb kutt

# Step 5 — Opening a Postgres Prompt with the New Role
# To log in with ident based authentication, you’ll need a Linux user with the same name as your Postgres role and database.

sudo adduser psql_ghost

# Once this new account is available, you can either switch over and connect to the database
sudo -i -u psql_ghost
psql -d kutt

\password psql_ghost

Install Redis

Follow instructions mentioned here

# Step 1 — Installing and Configuring Redis

sudo apt update
sudo apt install redis-server

sudo nano /etc/redis/redis.conf

Configure kutt

Modify .env file per your requirements


My nginx site config looks like this and works fine.

server {
    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    return 404; # managed by Certbot


server {
    server_name; # Replace with your domain

    access_log /var/log/l_mypad_acc.log;
    error_log /var/log/l_mypad_err.log;

    location / {
        proxy_pass http://localhost:3014;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


Setup Lets Encrypt

Use Lets Encrypt to secure you site for free! Just follow the instructions mentioned here. Works like magic!

Build Kutt

npm run build

Create kutt service

Setup kutt as a service:

sudo nano /etc/systemd/system/kutt_mypad.service

Description=Kutt on MyPad



ExecStart=/usr/local/bin/npm start
ExecStop=/usr/local/bin/npm stop

sudo systemctl enable kutt_mypad.service
sudo systemctl start kutt_mypad.service
sudo systemctl status kutt_mypad.service
sudo systemctl stop kutt_mypad.service

Create Api Key

Log into kutt and create your api-key

Install the Chrome Extension

Install the chrome extension available at and shorten any link easily after setting up the api-key. You don't get custom links using the extension. But, you could hack the code a little or be happy that you have shiny and tiny link anyway. Need help? Let's discuss.

Questions / Comment / Feedback

Drop me a note! ;-)