Deploy Linkwarden | (Just Updated) Bookmark Manager and Link Archiver, Admin Login Generated, Sign-up Closed

Linkwarden bookmark manager and link archiver, Postgres, search, REST API

Deploy Linkwarden | (Just Updated) Bookmark Manager and Link Archiver, Admin Login Generated, Sign-up Closed

postgres

postgres:17

Just deployed

/var/lib/postgresql

Just deployed

/data/data

Just deployed

/meili_data

Deploy and Host Linkwarden on Railway

Built for an LLM agent to deploy and use. The deploy form has nothing to fill in: the admin password is generated, public sign-up is closed, saved links, archived pages and the search index live on volumes, and a redeploy keeps them. Linkwarden is the open-source, self-hosted bookmark manager and link archiver: it saves a link together with a screenshot, a PDF and a readable copy of the page, organises links into collections with tags, and has full-text search and a REST API.

About Hosting Linkwarden

This template runs three services: linkwarden, the upstream Linkwarden image (version 2.17.0) pinned by digest, with its web app, REST API and archive worker; postgres, a private Postgres 17 database with its volume at /var/lib/postgresql; and search, a private Meilisearch (pinned by digest) with a volume at /meili_data. Archived pages, screenshots and PDFs are stored on a volume at /data/data of the linkwarden service.

No open registration. A stock Linkwarden has no way to create the first user except its public sign-up form, so on a public domain the first visitor becomes the owner. Here the start command creates the user admin from the generated ADMIN_PASSWORD before the app listens, only while the user table is empty, so a redeploy never overwrites a password you changed later. NEXT_PUBLIC_DISABLE_REGISTRATION is true, and an anonymous POST /api/v1/users answers 403.

What the template fixes for Railway. The app listens on Railway's injected PORT; NEXTAUTH_URL is the service's own https address; the start command waits for Postgres before the first migration and then runs the migrations, the web app and the worker together, as the upstream image does.

Using it. Open the service domain and sign in as admin with ADMIN_PASSWORD (read it from the linkwarden service variables). Add more users from the admin settings, or change the admin password there. For an agent, use the REST API as in the contract below.

Agent contract

  • Public URL: https:// plus the RAILWAY_PUBLIC_DOMAIN of the linkwarden service (set R to it in the snippet)
  • Private URL: http://linkwarden.railway.internal:8080
  • Credentials: the variable ADMIN_PASSWORD on the linkwarden service is the password of the user admin (the user name is not a template variable); POSTGRES_PASSWORD and MEILI_MASTER_KEY belong to the private postgres and search services
  • Auth: POST /api/v1/session with a JSON body holding username, password and sessionName returns a token; send it on every other call as Authorization: Bearer plus the token. A wrong login answers 400 and a request with no token or a wrong one answers 401, so write without key: 401. An anonymous sign-up answers 403, so public signup: 403
  • Health: GET /login returns 200
#!/bin/sh
# needs: R (the public URL, the https address of the service), ADMIN_PASSWORD (variable of the linkwarden service); also curl
R="${R:?set R to the https address of the service}"; J="Content-Type: application/json"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/login")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/login"
TOKEN=$(curl -s -H "$J" -d "{\"username\":\"admin\",\"password\":\"$ADMIN_PASSWORD\",\"sessionName\":\"agent\"}" "$R/api/v1/session" | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')
if [ -n "$TOKEN" ]; then echo "login: token issued"; else echo "login: FAILED"; fi
A="Authorization: Bearer $TOKEN"
# write with the token: save a link, read it back, delete it
ID=$(curl -s -H "$A" -H "$J" -d '{"url":"https://example.com","name":"railway check"}' "$R/api/v1/links" | sed -n 's/^{"response":{"id":\([0-9]*\),.*/\1/p')
if [ -n "$ID" ]; then echo "write link: saved id $ID"; else echo "write link: FAILED"; fi
curl -s -H "$A" "$R/api/v1/links/$ID" | grep -o '"name":"railway check"' | sed 's/^/link read back: /'
curl -s -o /dev/null -w "delete link: %{http_code}\n" -X DELETE -H "$A" "$R/api/v1/links/$ID"
# refusals
curl -s -o /dev/null -w "login wrong secret: %{http_code}\n" -H "$J" -d '{"username":"admin","password":"wrong-secret-1","sessionName":"x"}' "$R/api/v1/session"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$R/api/v1/links"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$J" -d '{"url":"https://example.com","name":"no key"}' "$R/api/v1/links"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "Authorization: Bearer wrong" -H "$J" -d '{"url":"https://example.com","name":"wrong key"}' "$R/api/v1/links"
curl -s -o /dev/null -w "public signup: %{http_code}\n" -H "$J" -d '{"name":"Visitor","username":"visitor","password":"visitor-pass-1234"}' "$R/api/v1/users"

A fresh deploy prints health: 200, login: token issued, write link: saved id 1, link read back: "name":"railway check" and delete link: 200. The refusals print login wrong secret: 400, read without key: 401, write without key: 401, write wrong key: 401 and public signup: 403: nothing is stored or created without the login.

Why Deploy Linkwarden on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Linkwarden on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

  • Agent-ready - generated admin password, a contract block and one script that proves login, a link write, read and delete, and the refusal of a read and a write with no token or a wrong one.
  • No open sign-up - the first user is created for you and registration is closed.
  • Data survives redeploys - links in Postgres, archives and search index on volumes.
  • Pinned - both upstream images are pinned by digest.

Common Use Cases

  • Self-hosted bookmark manager - a Pocket, Raindrop and Pinboard alternative you own.
  • Permanent archive of web pages - screenshots, PDFs and readable copies survive link rot.
  • Shared research collections - collections with tags and full-text search for a team.
  • Link memory for AI agents - an agent saves and queries links over the REST API.

Dependencies for Linkwarden Hosting

  • The linkwarden service, a private postgres service with a /var/lib/postgresql volume and a private search service with a /meili_data volume, all created by the template. Nothing else is required.

Deployment Dependencies


Template Content

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
NEW
Neo4j 2026.10 Community
Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

My Projects
0