Docs · Self-hosting

Self-host Slugy: requirements & setup

Community-supported. Core link management runs with a database plus Redis; every other service degrades gracefully or needs an account. MIT-licensed — commercial self-hosting included, unlike AGPL alternatives.

Mandatory

  • Node.js 20+ — Next.js 16 runtime.
  • Postgres 17+ (or Neon) + DATABASE_URL — primary store for links, workspaces, users.
  • BETTER_AUTH_SECRET — 32+ random characters for session signing.
  • Upstash Redis (REST URL + token) — link cache, rate limits, analytics batching. Without it every click hits Postgres and rate limiting is disabled.
  • NEXT_PUBLIC_ROOT_DOMAIN + NEXT_PUBLIC_APP_URL — routing between site and app subdomain (localhost:3000 / app.localhost:3000 locally).

Optional — feature degrades without it

  • Tinybird — realtime click-event pipeline; without it the dashboard falls back to Postgres counters.
  • Resend — transactional email; without it use direct DB user creation for local testing.
  • Polar — subscriptions; without it all workspaces behave as free and lead/revenue tracking stays gated.
  • Cloudflare R2 — avatar/OG uploads; links work without it.
  • Vercel integration — automatic custom-domain provisioning; otherwise add DNS/TLS manually per domain.
  • Inngest / QStash — background jobs and cron backfills.
  • Gemini / Groq API keys — AI slug suggestions and analytics Ask AI.

Local quickstart

git clone https://github.com/slugylink/slugy.git
cd slugy && npm install
docker compose up -d        # local Postgres only
cp .env.example .env.local  # fill DATABASE_URL, secrets, Redis
npx prisma generate && npm run db:push
npm run dev                 # :3000 + app.localhost:3000

Verify: create a link, open it incognito (expect a 302), open a bogus slug (expect a true 404 page, not the homepage). Production checklist — managed Postgres with backups, managed Redis with TLS, wildcard TLS for custom domains, CRON_SECRET set, dedicated LINK_PASSWORD_COOKIE_SECRET — plus the full matrix in docs/self-hosting.md.