---
title: "Deploy Slash Link Shortener with Docker and Dockge"
description: "Deploy Slash link shortener with Docker Compose and Dockge. Self-host bookmarks with custom short URLs, collections, analytics, and Cloudflare Tunnel access."
date: 2026-07-16
categories: ["self-hosting"]
tags: ["docker","slash","self-hosted"]
---

import Button from "@components/widgets/Button.astro";
import Notice from "@components/widgets/Notice.astro";
import ListCheck from "@components/widgets/ListCheck.astro";
import Tabs from "@components/widgets/Tabs.astro";
import Tab from "@components/widgets/Tab.astro";
import { Picture } from "astro:assets";
import YouTubeEmbed from "@components/widgets/YouTubeEmbed.astro";
import imag1 from "../../assets/images/24/01/slash-link-shortner.png";
import imag2 from "../../assets/images/24/01/slash-extension.png";
import imag3 from "../../assets/images/24/01/dockge-slash.png";
import imag4 from "../../assets/images/24/01/cloudflare-tunel-setup.png";
import imag5 from "../../assets/images/24/01/slash-add-links.png";

Slash is a self-hosted link shortener and bookmark manager you can deploy with Docker and Dockge in under 15 minutes. Since its initial release, the project has grown to over 3,200 GitHub stars and 100K+ Docker Hub pulls. It gives you full control over your short links. No third-party tracking, no monthly fees, and no rate limits.

Link shortening has real benefits for anyone managing links regularly:

- Makes URLs user-friendly and memorable
- Saves space in social media posts, emails, and messages
- Lets you redirect users based on device, location, or time
- Tracks clicks, conversions, and engagement with built-in analytics
- Keeps your original URLs and parameters hidden from the public

If you're comparing options, also check out [Sink, another self-hosted link shortener](https://www.bitdoze.com/sink-install/) that takes a different approach.

## What is Slash (A Self-Hosted Bookmark & Link Manager)

[Slash](https://github.com/yourselfhosted/slash) is an open source, self-hosted bookmarks and link sharing platform. It's built with Go on the backend and TypeScript/React on the frontend. The platform lets you organize links with tags, share them with custom shortened URLs, and track performance through analytics.

<Picture
  src={imag1}
  alt="Slash link shortener dashboard showing bookmark and link management interface"
/>

<ListCheck>
<ul>
<li>Custom short URLs: personalize links with your own paths (`s/link-url`)</li>
<li>Collections: group related shortcuts into virtual folders (`c/collection-name`)</li>
<li>Analytics: view referrers, browsers, operating systems, and click data</li>
<li>Dark mode: toggle via Profile -> Preference -> Color Theme</li>
<li>Team sharing: share link libraries with teammates</li>
<li>API access tokens: programmatic access to all Slash features</li>
<li>PostgreSQL support: alternative to the default SQLite for larger deployments</li>
<li>Browser extensions: Chrome and Firefox for saving links directly from your browser</li>
</ul>
</ListCheck>

<Notice type="info" title="License">
Slash is licensed under AGPL-3.0. You can self-host and modify it freely, but changes to the source code must be shared under the same license.
</Notice>

The **Collections** feature (added in v0.5.0) deserves a closer look. Collections are virtual folders that group related shortcuts. They have their own URL scheme (`c/collection-name`), visibility controls, and can be shared publicly or with teammates. This was the biggest improvement over the flat link list the original version offered.

Slash also supports internationalization (i18n) with Chinese translation as of v0.4.5, and API access tokens for programmatic access since v0.4.1.

### Browser extensions

Slash offers extensions for both Chrome and Firefox:

- [Chrome Web Store](https://chrome.google.com/webstore/detail/slash/ebaiehmkammnacjadffpicipfckgeobg)
- [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/your-slash/)

Both extensions let you save and shorten links directly from your browser, customize short URLs, and access Slash's bookmark management without leaving the page.

<Picture
  src={imag2}
  alt="Slash browser extension for Chrome and Firefox, save and shorten links directly"
/>

> If you are interested in more free, open source, self-hosted apps, check [toolhunt.net self hosted section](https://toolhunt.net/sh/).

## Deploy Slash with Docker Compose and Dockge

This guide uses Docker Compose for containerization, [Dockge](https://www.bitdoze.com/dockge-install/) for GUI-based stack management, and Cloudflare Tunnels for secure remote access. The modern Docker CLI uses `docker compose` (with a space). The old `docker-compose` (hyphen) was fully removed in April 2025.

<YouTubeEmbed
  url="https://www.youtube.com/embed/HswSqueUAQc"
  label="How to Deploy Your Link Shortener with Slash, Docker, and Dockge"
/>

### 1. Prerequisites

Before you begin, make sure you have the following in place:

- A VPS where you can host Slash. You can use [Hetzner](https://go.bitdoze.com/hetzner), [Hostinger](https://go.bitdoze.com/hostinger-vps), or use an [ASUS Mini PC](https://go.bitdoze.com/asus-dc510) as a [home server](https://www.bitdoze.com/best-mini-pc-home-server/)
- [Dockge installed](https://www.bitdoze.com/dockge-install/) on your server for Docker Compose management
- Cloudflare Tunnels configured for your VPS (details are covered in the Dockge install article)

<Notice type="warning" title="Docker Compose v1 is gone">
Docker Compose v1 (`docker-compose` with hyphen) was removed in April 2025. Use `docker compose` (space) instead. The `version:` field in compose files is also obsolete and should be removed.
</Notice>

> You can also [use Traefik as a reverse proxy](https://www.bitdoze.com/traefik-proxy-docker/) for your apps instead of Cloudflare Tunnels. I have a full tutorial with Dockge install that covers the setup.

### 2. Add the Docker Compose file in Dockge

Below is the Docker Compose file for Slash. Note there's no `version:` line. That field is obsolete in modern Docker Compose.

<Tabs>
<Tab name="Basic (SQLite)">

```yaml
services:
  slash:
    image: yourselfhosted/slash:latest
    container_name: slash
    ports:
      - 5006:5231
    volumes:
      - ./slash:/var/opt/slash
    restart: unless-stopped
```

This pulls the latest Slash image and creates a volume in the local path where the Dockge stack is located. You can change port `5006` to whatever you prefer.

</Tab>
<Tab name="With PostgreSQL">

```yaml
services:
  slash:
    image: yourselfhosted/slash:latest
    container_name: slash
    ports:
      - 5006:5231
    volumes:
      - ./slash:/var/opt/slash
    environment:
      - SLASH_DRIVER=postgres
      - SLASH_DSN=postgresql://user:password@db:5432/slash
    restart: unless-stopped
  db:
    image: postgres:16
    container_name: slash-db
    environment:
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=slash
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    restart: unless-stopped
```

PostgreSQL support was added in Slash v0.5.1. It's useful for larger deployments or if you're already running PostgreSQL. You can also configure these options via CLI flags: `--driver postgres --dsn 'postgresql://...'`. See our guide on how to [configure environment variables in Docker](https://www.bitdoze.com/docker-env-vars/) for more details.

</Tab>
</Tabs>

Slash also maintains an [official docker-compose.yml](https://github.com/yourselfhosted/slash/raw/main/docker-compose.yml) in the repository if you want a reference.

In Dockge, hit compose and save. After that, you can choose the Dockge-default external network:

<Picture src={imag3} alt="Dockge interface showing Slash Docker Compose stack deployment" />

Hit save and start the container. It should start running without issues.

### 3. Configure Cloudflare Tunnels for secure access

You need to tell Cloudflare Tunnel which port Slash is using. Go to your Cloudflare Zero Trust dashboard and configure the tunnel:

<Notice type="info" title="Updated navigation">
Cloudflare Zero Trust dashboard navigation was restructured. The new path is: **Zero Trust -> Networks -> Connectors -> Cloudflare Tunnels** (the old "Access -> Tunnels" path no longer exists).
</Notice>

Add a public hostname that maps a domain or subdomain to your Slash container's port (5006 in our example):

<Picture src={imag4} alt="Cloudflare Zero Trust Tunnel configuration, adding a public hostname for Slash" />

Enter your server IP and the port you chose in the compose file.

> You can also check [CloudPanel as a reverse proxy](https://www.bitdoze.com/cloudpanel-setup-dockge/) or [use Traefik as a reverse proxy](https://www.bitdoze.com/traefik-proxy-docker/) as alternatives to Cloudflare Tunnels. See also our [Cloudreve Docker guide](https://www.bitdoze.com/cloudreve-docker-setup/) for a similar Cloudflare Tunnel setup with another self-hosted app.

### 4. Access Slash and organize links with collections

Access Slash using the domain you configured in Cloudflare. On first visit, you'll be asked to create an admin account.

<Picture
  src={imag5}
  alt="Slash interface for adding and organizing links and collections"
/>

<ListCheck>
<ul>
<li>Create your admin account on first login</li>
<li>Add your first shortcut with `s/shortcut-name`</li>
<li>Create a collection with `c/collection-name` to group related links</li>
<li>Install the Chrome or Firefox browser extension</li>
<li>Toggle dark mode in Profile -> Preference -> Color Theme</li>
</ul>
</ListCheck>

Collections are the standout feature since the original version of this article. You can create collections like `c/dev-tools` or `c/social` to organize links into logical groups. Each collection has its own URL, can be set to public or private, and can be shared with teammates.

## Conclusion

Slash has matured since its early releases. With 3,200+ GitHub stars, PostgreSQL support, collections, API access tokens, and an active Discord community, it's a solid choice for anyone who wants a self-hosted link shortener with full control over their data.

The deployment is straightforward: Docker Compose handles the container, Dockge gives you a clean web UI to manage it, and Cloudflare Tunnels expose it securely without opening ports on your firewall. Slash is also available as a one-click deploy on Coolify if you prefer that workflow.

<Button text="Explore More Docker Containers" link="https://www.bitdoze.com/docker-containers-home-server/" variant="solid" color="blue" size="md" icon="arrow-right" />