Getting linkwarden right from the start saves hours of debugging later. In this comprehensive guide, we'll cover everything from initial setup to production-ready configuration, including bookmarks and management considerations.
Prerequisites
- Root or sudo access to the server
- Basic familiarity with the Linux command line
- A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
- A reverse proxy configured (Nginx or Traefik)
Docker Compose Setup
It's recommended to test this configuration in a staging environment before deploying to production. This helps identify potential compatibility issues and allows you to benchmark performance differences.
# docker-compose.yml
version: '3.8'
services:
linkwarden:
image: linkwarden/linkwarden:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- linkwarden_data:/data
- linkwarden_config:/config
environment:
- TZ=UTC
- PUID=1000
- PGID=1000
depends_on:
- db
db:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=linkwarden
- POSTGRES_USER=linkwarden
- POSTGRES_PASSWORD=changeme
volumes:
linkwarden_data:
linkwarden_config:
db_data:
This configuration provides a good balance between performance and resource usage. For high-traffic scenarios, you may need to increase the limits further.
- Monitor disk space usage and set up alerts
- Keep your system packages updated regularly
- Test your backup restore procedure monthly
- Enable automatic security updates for critical patches
- Review log files weekly for anomalies
Initial Configuration
For production deployments, consider implementing high availability by running multiple instances behind a load balancer. This approach provides both redundancy and improved performance under heavy load.
# Reverse proxy configuration
server {
listen 443 ssl http2;
server_name linkwarden.example.com;
ssl_certificate /etc/letsencrypt/live/linkwarden.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/linkwarden.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
client_max_body_size 0;
}
}
The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.
- Use version control for configuration files
- Maintain runbooks for common operations
- Document all configuration changes
- Set up monitoring before going to production
Reverse Proxy Integration
When scaling this setup, consider vertical scaling (adding more RAM/CPU) first, as it's simpler to implement. Horizontal scaling adds complexity but may be necessary for high-traffic applications.
# docker-compose.yml
version: '3.8'
services:
linkwarden:
image: linkwarden/linkwarden:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- linkwarden_data:/data
- linkwarden_config:/config
environment:
- TZ=UTC
- PUID=1000
- PGID=1000
depends_on:
- db
db:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=linkwarden
- POSTGRES_USER=linkwarden
- POSTGRES_PASSWORD=changeme
volumes:
linkwarden_data:
linkwarden_config:
db_data:
These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.
Data Persistence
Performance benchmarks show that properly tuned linkwarden can handle significantly more concurrent connections than the default configuration. The key improvements come from adjusting worker processes and connection pooling.
# Reverse proxy configuration
server {
listen 443 ssl http2;
server_name linkwarden.example.com;
ssl_certificate /etc/letsencrypt/live/linkwarden.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/linkwarden.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
client_max_body_size 0;
}
}
This configuration provides a good balance between performance and resource usage. For high-traffic scenarios, you may need to increase the limits further.
- Maintain runbooks for common operations
- Test disaster recovery procedures regularly
- Use version control for configuration files
- Document all configuration changes
Summary
You've successfully configured linkwarden on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.