How to Install Shlink on Ubuntu Server Latest
Shlink is a self-hosted URL shortener and link management platform that allows you to create short links and keep track of clicks. This tutorial will walk you through the installation of Shlink on Ubuntu Server Latest.
Prerequisites
Before starting, you need to have the following:
- A server running Ubuntu Server Latest
- SSH access to the server with a sudo-enabled user
- Docker and Docker Compose installed on the server
Step 1: Clone the Shlink repository
The first step is to clone the Shlink repository:
git clone https://github.com/shlinkio/shlink.git
Step 2: Configure the environment variables
Navigate to the cloned directory:
cd shlink
Create a copy of the .env.dist file and rename it to .env:
cp .env.dist .env
Open the .env file with a text editor:
nano .env
Set the environment variables based on your preferences. At a minimum, you need to set the SHLINK_BASE_URL to your server domain or IP address:
SHLINK_BASE_URL=https://example.com
Save and exit the file by pressing CTRL+X, then Y, and finally ENTER.
Step 3: Start Shlink with Docker Compose
Start the Shlink container:
sudo docker-compose up -d
Wait a few seconds until the container starts and check its status:
sudo docker-compose ps
You should see the following output:
Name Command State Ports
----------------------------------------------------------------------------------
shlink /docker-entrypoint.sh apac ... Up 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
Step 4: Verify the installation
Open your web browser and visit https://example.com. You should see the Shlink homepage:

Click on the login button in the top right corner:

Use the default credentials to log in:
- Email:
[email protected] - Password:
password
You should be redirected to the dashboard:

Congratulations! You have successfully installed Shlink on Ubuntu Server Latest.
Conclusion
In this tutorial, you learned how to install Shlink on Ubuntu Server Latest using Docker Compose. You should now be able to create short links and manage clicks from the Shlink dashboard.