How to Install Simply Shorten on Fedora Server

Simply Shorten is a URL shortener written in Python, which allows you to shorten long URLs into short ones. In this tutorial, you will learn how to install Simply Shorten on Fedora Server.

Prerequisites

Before starting, you need to have the following:

Step 1: Clone the Simply Shorten Repository

First, you need to clone the Simply Shorten repository from GitLab. To do this, follow these steps:

  1. Log in to your Fedora server instance as a sudo user.

  2. Open a terminal window.

  3. Run the following command to clone the repository:

    git clone https://gitlab.com/draganczukp/simply-shorten.git
    

Step 2: Install Required Dependencies

After cloning the repository, you need to install the required dependencies. To do this, follow these steps:

  1. Change to the simply-shorten directory:

    cd simply-shorten
    
  2. Run the following command to install the dependencies:

    pip3 install -r requirements.txt
    

Step 3: Configure the Application

Next, you need to configure the application by creating a configuration file. To do this, follow these steps:

  1. Copy the example configuration file to a new configuration file:

    cp config.example.yml config.yml
    
  2. Open the config.yml file and update the configuration settings as required. The configuration file contains various settings such as the database connection string, URL length, and secret key.

Step 4: Set Up the Database

Simply Shorten requires a PostgreSQL database to store the URLs. To set up the database, follow these steps:

  1. Install PostgreSQL on your Fedora server by running the following command in a terminal window:

    sudo dnf install postgresql-server
    
  2. Initialize the database by running the following command:

    sudo postgresql-setup initdb
    
  3. Start the PostgreSQL service by running the following command:

    sudo systemctl start postgresql
    
  4. Create a new database and user for Simply Shorten by running the following commands:

    sudo -u postgres psql
    CREATE DATABASE shorten;
    CREATE USER shorten WITH PASSWORD 'password';
    GRANT ALL PRIVILEGES ON DATABASE shorten TO shorten;
    \q
    

    Note: Replace 'password' with a strong, unique password.

Step 5: Run the Application

Finally, you can run the application using the following command:

python3 run.py

By default, Simply Shorten will run on port 5000. You can access it using the server's IP address or domain name followed by :5000 in a web browser.

Conclusion

Congratulations! You have successfully installed Simply Shorten on your Fedora Server. You can now start using it to shorten 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!