Installation
Clone the repository, install dependencies, and get LinkDen running locally.
๐ป Installation
Get LinkDen running on your machine in under 5 minutes.
๐ Prerequisites
- Bun 1.3+ -- Grab it from bun.sh.
- Node.js 24 --
bun devruns Alchemy under Node. - Cloudflare account -- A free account is enough for development.
1. ๐ Clone and Install
git clone https://github.com/mrdemonwolf/linkden.git
cd linkden
bun installTip:
bun installhandles all apps and packages in the monorepo automatically.
2. โ๏ธ Environment Setup
Copy the example file:
cp .env.example .envRequired Variables:
| Variable | Description | Example |
|---|---|---|
BETTER_AUTH_SECRET | Secret key for sessions | openssl rand -base64 32 |
BETTER_AUTH_URL | API server URL | http://localhost:3000 |
CORS_ORIGIN | Web frontend URL | http://localhost:3001 |
NEXT_PUBLIC_SERVER_URL | Public API URL | http://localhost:3000 |
NEXT_PUBLIC_SITE_URL | Public site URL | http://localhost:3001 |
3. ๐ Start Dev Servers
There are two ways to run LinkDen locally. Both apply the database migrations for you (option B with one command).
A. bun dev (everything, through Alchemy)
bun devbun dev runs the Alchemy program in dev mode: it starts the web app, the API and the docs and applies every migration in packages/db/src/migrations to a local D1. Alchemy keeps its state in the alchemy-state worker, so this needs ALCHEMY_STATE_TOKEN in .env (see the Cloudflare guide if you don't have one). In this mode apps/web/.env and apps/server/.env are loaded as well.
B. API and web separately (no Alchemy state needed)
# first run only: apply the migrations to the local D1
cd apps/server && for f in ../../packages/db/src/migrations/*.sql; do bunx wrangler d1 execute linkden-db --local --file="$f" --yes; done; cd ../..
bun dev:server # wrangler dev on :3000 (reads apps/server/.dev.vars)
bun dev:web # next dev on :3001- ๐ Web App:
http://localhost:3001 - โ๏ธ API Server:
http://localhost:3000 - ๐ Docs:
http://localhost:3002(bun dev:docs)
No
db:push. Schema changes go through migrations: editpackages/db/src/schema, runbun db:generate, and the new migration is applied on the nextbun dev/bun ship.bun db:resetwipes both local databases.
4. โ Verify It Works
- Visit:
http://localhost:3001/admin/setup. - Create Account: Enter your name, email, and password.
- Registration: The first user becomes the admin and registration locks automatically.
- Dashboard: You'll be redirected to the admin panel. You're all set!
Next Steps
- ๐ Quick Start -- Add your first links.
- โ๏ธ Configuration -- Deep dive into env vars.
- โ๏ธ Self-Hosting -- Deploy to Cloudflare.