Self-Hosting LinkStack with Docker Compose
What Is LinkStack?
LinkStack is a self-hosted alternative to Linktree, Lnk.Bio, and similar link-in-bio services. It creates a customizable page where you list your social profiles, websites, and other links in one place. Multi-user support means you can host link pages for an entire team or organization. Custom themes, built-in analytics, and no monthly fees. If you’re paying Linktree $5-24/month for a page of links, LinkStack replaces it with a single Docker container.
Official site: linkstack.org | GitHub
Prerequisites
- A Linux server or Raspberry Pi
- Docker and Docker Compose installed (guide)
- 200 MB of free disk space
- 128 MB of RAM minimum
- A domain name (recommended — link pages need a public URL)
Docker Compose Configuration
services:
linkstack:
image: linkstackorg/linkstack:v4.8.6
container_name: linkstack
restart: unless-stopped
ports:
- "8090:80"
environment:
- SERVER_ADMIN=admin@example.com
- HTTP_SERVER_NAME=links.example.com
- HTTPS_SERVER_NAME=links.example.com
- TZ=UTC
- PHP_MEMORY_LIMIT=256M
- UPLOAD_MAX_FILESIZE=8M
volumes:
- linkstack-data:/htdocs
networks:
- linkstack-net
volumes:
linkstack-data:
networks:
linkstack-net:
LinkStack uses SQLite internally — no external database needed.
Start the stack:
docker compose up -d
Initial Setup
Access LinkStack at http://your-server-ip:8090. The setup wizard walks you through:
- Application settings — site name, language, theme
- Admin account — create your administrator login
- Done — start adding links
Creating Your Link Page
- Log in to the admin panel
- Click Add Link to add social profiles, websites, or custom URLs
- Drag and drop to reorder links
- Choose a theme from the built-in collection or customize with CSS
- Your page is live at
http://your-server-ip:8090/@username
Configuration
Custom Themes
LinkStack includes multiple built-in themes. To switch themes: Admin Panel → Appearance → Select theme. For custom CSS, use the built-in style editor to modify colors, fonts, and layout without touching files.
Multi-User Mode
Enable registration in Admin Panel → Config → Allow Registration. Each user gets their own link page at /@username. Useful for teams or organizations where everyone needs a link page.
| Setting | Description |
|---|---|
| Allow registration | Open or closed signups |
| User role | Regular user or admin |
| Custom domains | Per-user custom domains (via reverse proxy) |
| Analytics | Per-link click tracking |
| Social icons | Auto-detected from URL |
Analytics
LinkStack tracks clicks per link. View analytics in the admin panel — total clicks, clicks per link, and click trends. No external analytics service needed.
Custom Buttons
Beyond standard links, LinkStack supports custom button styles:
- Standard links with icons
- Social media buttons (auto-detects platform from URL)
- Email links
- Phone links
- Custom HTML blocks
- Heading dividers for organizing sections
Reverse Proxy
Set HTTP_SERVER_NAME and HTTPS_SERVER_NAME to your domain. For proxy configuration, see Reverse Proxy Setup.
Backup
Back up the linkstack-data volume — it contains the SQLite database, user uploads, and configuration:
docker compose cp linkstack:/htdocs ./linkstack-backup-$(date +%Y%m%d)
For a full backup strategy, see Backup Strategy.
Troubleshooting
Links Not Saving
Symptom: Added links disappear after saving.
Fix: The SQLite database may be read-only. Check volume permissions:
docker compose exec linkstack ls -la /htdocs/database/
Ensure the database file is writable by the container user.
Custom Domain Not Working
Symptom: Accessing via custom domain shows default Apache page.
Fix: Set HTTP_SERVER_NAME and HTTPS_SERVER_NAME to match your domain exactly. Restart the container after changing environment variables.
Theme Not Applying
Symptom: Selected theme doesn’t render correctly.
Fix: Clear your browser cache. If using a reverse proxy, ensure CSS and JS assets aren’t being cached with stale headers.
Resource Requirements
- RAM: ~30 MB (Apache + PHP + SQLite)
- CPU: Minimal — static page rendering
- Disk: ~100 MB for the application, grows slowly with user avatars
Verdict
LinkStack is the best self-hosted Linktree replacement. One container, SQLite database, under 30 MB RAM, and it does everything Linktree does — custom themes, analytics, social icons, multi-user support. The built-in theme collection looks professional out of the box. For a minimal alternative with fewer features but even simpler setup, see LittleLink. If you just need a personal page and don’t care about multi-user or analytics, LittleLink is lighter. For anything beyond that, LinkStack wins.
Frequently Asked Questions
Is LinkStack really free for commercial use?
Yes. LinkStack is licensed under the GNU Affero General Public License v3 (AGPL-3.0), which allows free commercial use. You can host link pages for your business, team, or clients without any licensing fees. The AGPL requires you to share modifications to LinkStack’s source code if you distribute them, but self-hosting for your own use has no restrictions.
How does LinkStack compare to Linktree?
LinkStack replaces Linktree entirely for most users. It includes custom themes, per-link analytics, social icon auto-detection, multi-user support, and custom buttons — all features that Linktree charges $5-24/month for. The trade-off is you host it yourself, which means managing a server. But at under 30 MB RAM with zero dependencies, the hosting overhead is minimal.
Can I run LinkStack on a Raspberry Pi?
Yes. LinkStack uses Apache + PHP + SQLite and consumes under 30 MB of RAM. A Raspberry Pi 3 or newer runs it comfortably. Use the same Docker Compose configuration — the official image supports ARM architectures.
Does LinkStack support custom domains per user?
Yes, in multi-user mode. Each user can have a custom domain pointed to their link page through reverse proxy configuration. Set up DNS records and proxy rules for each custom domain pointing to the LinkStack instance, and users access their pages at their own domain.
Can I import my links from Linktree?
LinkStack doesn’t have a direct Linktree import feature. You’ll need to manually add your links through the admin panel. With a small number of links (typically 10-20 per page), this takes only a few minutes. The drag-and-drop interface makes reordering quick.
Does LinkStack track link clicks?
Yes. LinkStack includes built-in analytics that track clicks per link without any external analytics service. View total clicks, per-link click counts, and click trends in the admin panel. No cookies or JavaScript tracking — it counts server-side redirects.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments