Installing Schort on Ubuntu Server Latest

Schort is a URL shortener that is open-source software. It is a simple and effective way to create short URLs to share and track links. In this tutorial, we will go through the steps to install Schort on Ubuntu Server Latest.


Prerequisites

Before you can install Schort on Ubuntu Server Latest, there are some prerequisites that need to be installed on the server. Please make sure the server is updated and you have root access to install the following packages.

Use the following commands to install Git and Node.js:

sudo apt-get update
sudo apt-get install git
sudo apt-get install nodejs
sudo apt-get install npm

After the installation, check the version of Node.js installed on the server:

nodejs --version

Install and Configure MongoDB

Schort requires a database to store the URL data. We will use MongoDB, which is a NoSQL database. Run the following commands to install MongoDB:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org

After the installation, start the MongoDB service:

sudo systemctl start mongod.service

Clone Schort from Github

In this step, we will clone Schort from Github into the server. Use the following commands to go into the home directory and clone the repository:

cd ~/
git clone https://github.com/sqozz/schort.git

Install Schort Dependencies

Schort uses NPM to manage its dependencies. Go into the Schort directory and install the dependencies using the following command:

cd schort/
npm install

Configure Schort

Schort uses a configuration file to store its settings. Rename the config.example.json to config.json and change the settings to match your environment.

cp config.example.json config.json
nano config.json

Edit the config.json file to match your environment.

{
    "mongoUrl": "mongodb://localhost/schort",
    "domain": "http://localhost:8080",
    "port": 8080,
    "keyLength": 7
}

Start Schort

Now that Schort has been configured, it is ready to be started. Use the following command to start Schort:

npm start

You should get the following output:

> schort@0.0.1 start /home/user/schort
> node ./bin/www

Schort listening on port 8080

Additional Setup

Schort is now installed and running. However, to run Schort as a daemon and start on system boot, you will need to configure it accordingly.

You can use forever to run Schort as a daemon. Use the following command to install forever:

sudo npm install -g forever

Use forever to start Schort as a daemon:

forever start bin/www

Congratulations! You have successfully installed Schort on Ubuntu Server Latest. You can now use it as your own URL shortener.

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!