# Linkwarden Bookmark Manager

> Self-hosted collaborative bookmark manager with link archiving, tags, and collections.

- Category: Productivity & Collaboration
- Difficulty: intermediate
- Components: linkwarden, postgresql, nginx
- Tags: bookmarks, linkwarden, archiving, collaboration, self-hosted
- Source: https://docker.recipes/productivity/linkwarden-bookmark-manager

## Overview

Linkwarden is a modern, self-hosted bookmark manager designed for collaborative teams and power users who need more than basic bookmarking functionality. Built with Next.js and TypeScript, Linkwarden provides advanced features like automatic link archiving, screenshot capture, full-text search, and organized collections with tagging systems. Unlike simple bookmark syncing tools, Linkwarden preserves webpage content even when original sites go offline, making it invaluable for research, documentation, and long-term reference management. This stack combines Linkwarden with PostgreSQL for robust data management and NGINX for production-ready web serving. PostgreSQL provides the reliability and performance needed for complex bookmark queries, tag relationships, and user management, while NGINX handles SSL termination, static asset delivery, and reverse proxy functionality. The combination creates a professional-grade bookmark management system that can handle multiple users, large bookmark collections, and high-traffic scenarios with excellent performance. This configuration is ideal for development teams, research organizations, content creators, and knowledge workers who need centralized bookmark management with collaboration features. The stack provides enterprise-level reliability while remaining simple enough for small teams or personal use, offering the perfect balance between functionality and maintainability for serious bookmark management needs.

## Features

- Automatic webpage archiving with Wayback Machine integration and local screenshot capture
- PostgreSQL-powered full-text search across bookmark titles, descriptions, and archived content
- Collaborative collections with granular sharing permissions and team workspaces
- Advanced tagging system with hierarchical organization and tag-based filtering
- Browser extension support for Chrome, Firefox, and Safari with one-click bookmarking
- Link validation and monitoring with automatic broken link detection
- NGINX-based SSL/TLS termination with HTTP/2 support for fast page loading
- REST API with authentication for custom integrations and bulk operations

## Use cases

- Research teams managing academic papers, articles, and reference materials with archival requirements
- Development teams sharing technical documentation, tutorials, and code repositories
- Content marketing teams organizing competitor analysis, inspiration, and resource libraries
- Legal firms archiving case law, regulations, and client-related web resources
- Personal knowledge management for professionals building comprehensive reference collections
- Educational institutions providing students and faculty with collaborative research tools
- Non-profit organizations maintaining resource libraries for volunteers and stakeholders

## Prerequisites

- Docker and Docker Compose installed with at least 2GB available RAM for PostgreSQL
- Domain name and SSL certificates if deploying for external access via NGINX
- Basic understanding of environment variable configuration for database and authentication setup
- Ports 80, 443, and 3000 available on the host system for web access
- At least 10GB available disk space for bookmark archives and database storage
- SMTP server credentials if email notifications and user invitations are required

## docker-compose.yml

```yaml
services:
  linkwarden:
    image: ghcr.io/linkwarden/linkwarden:latest
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
      NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
      NEXTAUTH_URL: ${NEXTAUTH_URL}
    ports:
      - "3000:3000"
    volumes:
      - linkwarden_data:/data/data
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - linkwarden-net
    restart: unless-stopped

  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - linkwarden-net
    restart: unless-stopped

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - linkwarden
    networks:
      - linkwarden-net
    restart: unless-stopped

volumes:
  linkwarden_data:
  postgres_data:

networks:
  linkwarden-net:
    driver: bridge
```

## .env

```bash
# PostgreSQL
POSTGRES_USER=linkwarden
POSTGRES_PASSWORD=secure_postgres_password
POSTGRES_DB=linkwarden

# NextAuth
NEXTAUTH_SECRET=your_secret_key_here
NEXTAUTH_URL=http://localhost:3000
```

## Usage notes

- Web UI at http://localhost:3000
- Create account on first visit
- Supports link archiving and screenshots
- Browser extensions available

## Troubleshooting

- Linkwarden shows 'Database connection failed': Verify DATABASE_URL format and ensure PostgreSQL container is healthy before Linkwarden starts
- NextAuth authentication errors: Check NEXTAUTH_SECRET is set to a secure random string and NEXTAUTH_URL matches your actual domain
- Screenshots and archiving not working: Ensure linkwarden_data volume has proper write permissions and sufficient disk space
- NGINX 502 Bad Gateway errors: Confirm Linkwarden container is running on port 3000 and accessible within the Docker network
- PostgreSQL container fails to start: Check POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB environment variables are properly set
- Slow bookmark loading and search: Increase PostgreSQL shared_buffers and work_mem settings for better query performance

