What you will set up
Linkwarden saves your bookmarks, and keeps its own copy of each page: a screenshot, a PDF, a readable text version and a single-file copy of the page itself. When a page changes or disappears, your copy stays. You sort links into collections, tag them, share collections with others, and search the text of every page you saved.
Here it runs as a Compose project under a user of its own called linkwarden, behind Caddy from the Docker guide: Linkwarden itself, PostgreSQL for its data, and Meilisearch for its search.
The app-specific results below come from the tested Podman guide on a Melonslab server with Debian 13:
- Linkwarden 2.16.3 saved a page, and within a minute made all four copies of it.
- A search for a word that appeared only in the page's text found it.
- Once sign-ups were turned off, a new account could not be created.
- Everything came back by itself after a reboot.
In the Podman test, the pod used about 500 MB of memory, and more for a short while each time it saves a page, since it opens the page in a browser.
The Docker version below follows the tested rootless Docker base guide. The app-specific results above come from the tested Podman guide on a Melonslab server; they were not measured under Docker.
Before you start
You need:
- a server set up as in the Docker guide, with Caddy running;
- an A record and an AAAA record for
links.example.compointing at your server.
Replace links.example.com with your own name throughout.
1. Create the user
As root:
useradd -m -s /bin/bash linkwarden
loginctl enable-linger linkwarden
uid=$(id -u linkwarden)
Everything up to step 4 runs as linkwarden.
2. Create the secrets
The passwords are generated with the Compose file in the next step and kept in a 0600 file under the app directory.
The file holds the database password for PostgreSQL and the address Linkwarden connects to, the secret that signs Linkwarden's logins and the Meilisearch key.
3. Define the Compose project
Create a Compose file in the app's directory. It uses the same images, ports, volumes, environment and restart policy as the Podman guide:
mkdir -p /home/linkwarden/linkwarden
cat > /home/linkwarden/linkwarden/compose.yaml <<'YAML'
services:
db:
image: docker.io/library/postgres:16-alpine
volumes:
- db:/var/lib/postgresql/data
env_file: linkwarden.env
restart: always
search:
image: docker.io/getmeili/meilisearch:v1.13.3
volumes:
- search:/meili_data
environment:
MEILI_ENV: production
MEILI_NO_ANALYTICS: "true"
env_file: linkwarden.env
restart: always
app:
image: ghcr.io/linkwarden/linkwarden:latest
ports:
- "127.0.0.1:8096:3000"
volumes:
- data:/data/data
environment:
NEXTAUTH_URL: https://links.example.com/api/v1/auth
MEILI_HOST: http://127.0.0.1:7700
env_file: linkwarden.env
restart: always
volumes:
db:
search:
data:
YAML
umask 077
dbpw=$(openssl rand -hex 24)
printf 'POSTGRES_PASSWORD=%s\nDATABASE_URL=postgresql://postgres:%s@127.0.0.1:5432/postgres\nNEXTAUTH_SECRET=%s\nMEILI_MASTER_KEY=%s\n' "$dbpw" "$dbpw" "$(openssl rand -hex 32 | tr -d '\n')" "$(openssl rand -hex 32 | tr -d '\n')" > /home/linkwarden/linkwarden/linkwarden.env
unset dbpw
chmod 600 /home/linkwarden/linkwarden/linkwarden.env
chown -R linkwarden:linkwarden /home/linkwarden/linkwarden
uid=$(id -u linkwarden)
runuser -u linkwarden -- env HOME=/home/linkwarden XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/linkwarden/linkwarden && docker compose up -d"
Use the weekly docker-update.service/docker-update.timer from the rootless Docker guide instead of Podman's auto-update timer. It runs docker compose pull and docker compose up -d in the app directory each Sunday. Set it up once for linkwarden as shown there; it covers every Compose app in that user's home.
The first start downloads the images, which take about 2.2 GB of disk, and takes a couple of minutes.
4. Put Caddy in front
Go back to root with exit, switch to runuser -u caddy -- /bin/bash, and add this block at the end of ~/Caddyfile:
links.example.com {
reverse_proxy 127.0.0.1:8096
}
Restart Caddy with docker compose restart caddy from /home/caddy/caddy as caddy.
5. Create your account, then close sign-ups
Open https://links.example.com/register, and create your account with a Display Name, a Username and a Password. Then log in. Create accounts for anyone else who will use it the same way.
Anyone who finds the address can sign up until you close it. As linkwarden, add NEXT_PUBLIC_DISABLE_REGISTRATION: "true" under app.environment in compose.yaml.
Then restart Linkwarden:
uid=$(id -u linkwarden)
runuser -u linkwarden -- env HOME=/home/linkwarden XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/linkwarden/linkwarden && docker compose up -d --force-recreate app"
A sign-up after that gets Registration is disabled.
6. Save links
Choose New Link, paste an address, and pick a collection and tags if you like. Within a minute, the link shows its preview, and its menu has the screenshot, the PDF, the readable version and the copy of the page. The search at the top looks through names, addresses, tags and the text of every saved page.
Linkwarden also has browser extensions and apps for phones, which log in with your server's address, https://links.example.com, and your account.
7. Back up
As linkwarden:
uid=$(id -u linkwarden)
runuser -u linkwarden -- env HOME=/home/linkwarden XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash <<'SH'
cd /home/linkwarden/linkwarden
umask 077
mkdir -p ~/backup
docker compose exec -T db pg_dump -U postgres postgres > ~/backup/linkwarden-db.sql
docker compose stop app search
tar -cf ~/backup/linkwarden-data.tar -C /home/linkwarden/linkwarden data
tar -cf ~/backup/linkwarden-search.tar -C /home/linkwarden/linkwarden search
docker compose up -d search app
SH
That saves your accounts, links and collections, the saved copies of the pages, and the search index. Copy ~/backup to another machine, and keep it private.
Troubleshooting
Links never get a preview or copies. Linkwarden's worker makes them, and logs each link it works on: docker compose logs app | grep worker shows what happened.
A sign-up still works after step 5. The NEXT_PUBLIC_DISABLE_REGISTRATION line is missing, or Linkwarden was not restarted after daemon-reload.