Deploy Linkwarden on TerraMaster NAS Using Docker Compose

Guides created and maintained by community members, not official documentation.
Post Reply
User avatar
Kevin
Posts: 8
Joined: 26 Jan 2024, 14:10
China

Deploy Linkwarden on TerraMaster NAS Using Docker Compose

Post by Kevin »

๐Ÿš€ Deploy Linkwarden on TerraMaster NAS Using Docker Compose

Linkwarden is an open-source, self-hosted bookmark manager that supports web archiving, full-text search, tagging, and more. This guide will walk you through deploying Linkwarden on your TerraMaster NAS using Docker Compose.



โœ… Tutorial Goal:

Use Docker Compose to deploy the following services:
  • PostgreSQL: Database service
    Meilisearch: Full-text search engine
    Linkwarden: Main web UI application


๐Ÿงฐ Prerequisites:
  1. TerraMaster NAS with Docker Engine and Docker Manager installed
    NAS is connected to the internet


๐Ÿ“ Step 1: Create Directory Structure (with illustration)

Create the following directory structure:

Code: Select all

/Volume1/docker/
โ”œโ”€โ”€ linkwarden/
โ”œโ”€โ”€ system/

Image

๐Ÿ“ฆ About the "system" Folder:

We will set Docker's data-root to /Volume1/docker/system. Benefits include:
  • โœ… Avoid using root directory space
    โœ… Centralized container data for easier backup and migration
    โœ… Prevent Docker failures due to system disk space running out


๐Ÿ“‚ Step 2: Upload Configuration Files (.env and docker-compose.yml)

Upload the following two files to:

Code: Select all

/Volume1/docker/linkwarden/
Upload Methods:
  • Use the NAS file manager
    Upload via SMB (network share) from your PC
Image



๐Ÿ› ๏ธ Step 3: Create docker-compose.yml

In the /Volume1/docker/linkwarden/ directory, create a file named docker-compose.yml with the following content:

Code: Select all

version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    env_file: .env
    restart: always
    volumes:
      - ./pgdata:/var/lib/postgresql/data

  meilisearch:
    image: getmeili/meilisearch:v1.12.8
    restart: always
    env_file:
      - .env
    volumes:
      - ./meili_data:/meili_data

  linkwarden:
    image: ghcr.io/linkwarden/linkwarden:latest
    restart: always
    env_file: .env
    environment:
      - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
    ports:
      - "3000:3000"
    volumes:
      - ./data:/data/data
    depends_on:
      - postgres
      - meilisearch



๐Ÿ” Step 4: Create .env Environment File

In the same directory, create a file named .env with the following content:

Code: Select all

NEXTAUTH_SECRET=devsecret1234567890

DATABASE_URL=postgresql://postgres:123456@db:5432/postgres

POSTGRES_PASSWORD=123456
โš ๏ธ Be sure to change the password and secret to secure values. Never use default credentials in production environments.



โš™๏ธ Step 5: Configure Docker to Use Custom Data Directory (Recommended)

To avoid using the default Docker data directory /var/lib/docker, we will change it to /Volume1/docker/system.

Configuration File Path:

Code: Select all

/Volume1/@apps/DockerEngine/conf/daemon.json
Edit daemon.json as follows:

Code: Select all

{
"registry-mirrors": [
"https://registry-1.docker.io",
"https://ghcr.io"
],
"data-root": "/Volume1/docker/system"
}
๐Ÿ“Œ After editing, restart the DockerEngine service.
Image
โœ… Benefits:
  • โœ”๏ธ Centralized storage of all container data
    โœ”๏ธ Avoid system disk space issues
    โœ”๏ธ Better suited for long-running services

๐Ÿš€ Step 6: Start Linkwarden Using Docker Manager
  1. Open TOS โ†’ Launch Docker Manager
    Click Compose Projects on the left
    Click Create in the top-right corner
    Fill in project information:
    • Project Name: linkwarden
      Project Path: /Volume1/docker/linkwarden
      Select the docker-compose.yml file
    Click Validate โ†’ Apply
โœ… Check Container Status:
  • Go back to the "Projects" page
    Confirm the containers are running
    If there are errors, click the container to view logs


๐ŸŒ Step 7: Access Linkwarden Web Interface

In your browser, go to:

Code: Select all

http://your-NAS-IP:3000
You should see the Linkwarden login or registration screen:

Image



โœ… Summary:

By following this tutorial, youโ€™ve successfully deployed the following services on your TerraMaster NAS:
  • PostgreSQL Database
    Meilisearch Search Engine
    Linkwarden Self-hosted Bookmark System
You can now save, archive, and search web content freely! ๐Ÿ“Œโœจ
User avatar
MikeZhang
TM Support
Posts: 381
Joined: 05 Sep 2023, 22:21

Re: Deploy Linkwarden on TerraMaster NAS Using Docker Compose

Post by MikeZhang »

Thanks for sharing your experience with us, Kevin.
To contact our team, please send email to following addresses, remember to replace (at) with @

Technical team: support(at)terra-master.com(for technical support)
Service team: service(at)terra-master.com(for purchasing, return, replacement, RMA service)
Post Reply

Return to โ€œCommunity-Created Guidesโ€