How to Install Kutt on Debian Latest

Kutt is a self-hosted URL shortener that's free and open-source. It allows you to shorten long URLs to be more manageable.

In this tutorial, you will learn how to install Kutt on Debian Latest.

Prerequisites

Before starting with the installation process, make sure you have the following prerequisites:

Step 1: Update the system

The first step is to update the system to ensure that you have the latest software.

To do this, connect to your server via SSH and run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Node.js

Kutt is built using Node.js, so the first thing you need to do is to install Node.js on your server.

To install Node.js, run the following commands:

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Verify the installation by checking its version using this command:

node -v

Step 3: Install Git

Kutt is stored in a Git repository, so you need to install Git on your server so that you can clone the repository.

To install Git on Debian, run the following command:

sudo apt-get install git

Step 4: Clone Kutt's repository

Now, you can clone Kutt's repository to your server.

To clone the repository, run the following command:

git clone https://github.com/thedevs-network/kutt.git

This will download Kutt's repository to your server.

Step 5: Install Kutt's dependencies

After cloning the repository, navigate to the Kutt's directory using the following command:

cd kutt

Now, you need to install all of Kutt's dependencies by running the following command:

npm install --production

Step 6: Configure Kutt

Kutt requires a configuration file to run. Copy the default configuration file using the following command:

cp .env.example .env

Next, you need to modify the .env file according to your preferences. Open the file using a text editor:

nano .env

You will see the following:

NODE_ENV=production

# App
APP_PORT=3000
APP_HOST=https://ghost.lilboadi.com

# Database
DB_TYPE=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=kutt
DB_USER=root
DB_PASS=123456

Change the following settings:

APP_PORT=80
APP_HOST=your-domain.com # replace with your domain name
DB_TYPE=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=kutt # you can change this name to anything you want
DB_USER=root # replace 'root' with your MySQL username
DB_PASS=your-password # Replace 'your-password' with your MySQL password

Save the file and exit.

Step 7: Create the Database

Kutt requires a database to store information. You can use MySQL or SQLite, but in this tutorial, we will use MySQL.

To create a database, log in to your MySQL server:

mysql -u root -p

Enter your MySQL password when prompted.

Then, create a database using the following command:

CREATE DATABASE kutt;

Next, create a user and grant privileges to the database:

CREATE USER 'kuttuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON kutt.* TO 'kuttuser'@'localhost';
FLUSH PRIVILEGES;

Change 'password' to your own password.

Exit MySQL by typing exit.

Step 8: Start the Application

Now that you have installed all dependencies and configured the application, you can start the Kutt application using the following command:

npm run start

This will start the server at port 80 as specified in the .env configuration file.

You can now go to your domain name in your web browser to verify if Kutt is working.

Conclusion

In this tutorial, we have shown you how to install Kutt on Debian Latest. You can now start using Kutt to shorten your long URLs.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!