Hosting Your Own Link Shortener Slash on a VP

THE.HostingTHE.Hosting
4 min read

Slash is an open-source web application that lets you create and customize short links (or shortcuts, as the developers call them) and store them securely on your own server.

What’s more, Slash allows you to add tags and group links into collections. That’s especially handy if you’re working on multiple projects (like personal and work-related) and want to keep everything nicely organized.

Another useful feature is analytics. You can track how often each link is clicked, where the traffic is coming from, and how effective it is. For bloggers and marketers, this feature can be a real game-changer.

So essentially, Slash is a link shortener on steroids — with features you'd expect from a full-fledged link and bookmark manager.

As always, we’ll be running all our tests on a high-performance server from THE.Hosting.
Want one too? Hit the link and place your order!

Why Host It Yourself?

At this point, many might ask: why bother hosting your own app on a VPS when there are tons of free link shortener websites out there?

The answer is simple: convenience and security. As users, we can’t be completely sure that public services don’t embed trackers or even malicious code into shortened URLs. So why take the risk? Hosting an open-source solution gives you full control. You can be confident that no one is tampering with your links.

How to Install Slash

Slash runs in a Docker container, so, first, we’ll need to install Docker itself. I’ll show you how to do it using apt. If you prefer another method, Docker’s official site offers alternative installation instructions.

Let’s start by updating repositories and adding the GPG key:

apt-get update

apt-get install ca-certificates curl

install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

sudo chmod a+r /etc/apt/keyrings/docker.asc

Next, add Docker’s repository to apt:

echo \

"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \

$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \

tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get update

Now install Docker:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Now It’s Time to Install Slash

The good news is you only need a single command:

docker run -d --name slash -p 5231:5231 -v ~/.slash/:/var/opt/slash yourselfhosted/slash:latest

As before, I’m testing this on our entry-level Aluminium VPS, which has:

  • 1 Xeon E5-2697A core

  • 1 GB of RAM

  • 25 GB SSD storage

Let’s Break Down the Command

Running unfamiliar commands in your terminal isn’t the best habit — so here’s a quick explanation of what this one does:

  • docker run — tells Docker to create and run a new container

  • -d — runs the container in the background (detached mode)

  • --name slash — names the container “slash” so it’s easier to manage

  • -p 5231:5231 — maps port 5231 inside the container to the same port on your host so you can access Slash in your browser

  • -v ~/.slash/:/var/opt/slash — creates a volume on your machine to store Slash data, making sure it’s persistent across restarts

  • yourselfhosted/slash:latest — specifies the Docker image to use, in this case, the latest version of Slash

Accessing Slash

Once the container is running, Slash will be available at:
http://your-server-ip:5231

You’ll be prompted to register — it’s a simple, standard sign-up process.

After that, you’ll land on the main dashboard of the service.

Using Slash

Let’s go through an example to show what Slash can do.

We’ll take a long, Cyrillic-heavy URL from Wikipedia:
https://ru.wikipedia.org/wiki/%D0%A1%D0%BA%D0%BE%D0%B2%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5_%D0%BE%D0%B4%D0%BD%D0%BE%D0%B9_%D1%86%D0%B5%D0%BF%D1%8C%D1%8E

Because of the Cyrillic characters, the link turns into a confusing string of symbols. You definitely wouldn’t want to paste that into a database or documentation. That’s where Slash comes in.

Here’s how it works:

  1. Click Create

  2. Fill out the two required fields — Name (the custom part of your shortened URL) and Link (the original URL)

  3. Optionally, add a Title, Description, and tags for easy filtering and sorting later

You’ll end up with a clean link like:
http://your-server-ip/s/Nau

Ideally, you could even register a custom domain name and connect it to your Slash instance — but that’s a different story.

Would you host an app like this on your server? Let me know in the comments!

And if you know about a cool and lesser-known self-hosted service — drop a note too. I’ll test it out and maybe feature it in an upcoming article!

0
Subscribe to my newsletter

Read articles from THE.Hosting directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

THE.Hosting
THE.Hosting