Installing Linkwarden on a VPS: Self-Hosted Bookmark Manager with Tags and Collections
TL;DR
In this detailed guide, we will step-by-step set up Linkwarden — a powerful self-hosted bookmark manager — on your Virtual Private Server (VPS). You will learn how to prepare an Ubuntu 24.04 LTS based server, install Docker, deploy Linkwarden using Docker Compose, configure secure access via HTTPS using Caddy, and implement a backup strategy to protect your data.
- Setting up Linkwarden on a VPS for full control over your bookmarks.
- Using Docker and Docker Compose for easy installation and management.
- Ensuring security with HTTPS (Caddy) and basic server protection.
- Deployment on Ubuntu 24.04 LTS with up-to-date software versions for 2026.
- Implementing a backup system for data preservation.
- Obtaining a full-featured bookmark manager with tags, collections, and search.
What we are setting up and why
We will be installing Linkwarden — an open-source and self-hosted solution for saving, organizing, and archiving web links. In a world where information constantly changes and articles and websites disappear, Linkwarden allows you to save not only links but also full copies of web pages, ensuring their permanent availability. This is an ideal tool for those who actively work with information, conduct research, collect useful resources, or simply want to have a reliable archive of their favorite sites.
Ultimately, you will get a fully functional, private bookmark manager, accessible from anywhere in the world via your own domain. It will be equipped with powerful search, the ability to add tags and create collections, as well as a page archiving function to prevent content from disappearing. This means full control over your data and no dependence on third-party services that may change their policies or cease to exist.
Alternatives and why self-hosted on a VPS
There are many solutions for bookmark management. These include cloud services such as Pocket, Raindrop.io, Instapaper, as well as other self-hosted options like Wallabag or Shaarli.
- Cloud services: Convenient, require no setup, but you entrust your data to a third party, and functionality is often limited by paid subscriptions. You do not control data storage and its privacy.
- Other self-hosted solutions: Wallabag and Shaarli are also excellent projects, but Linkwarden stands out with its modern interface, active development, and a set of features that are often more focused on "archiving" and "knowledge management" than just "saving for later reading."
Choosing a self-hosted solution on a VPS gives you full sovereignty over your data. You decide where and how your bookmarks are stored, who has access to them, and what features you use. This is especially important for developers, researchers, teams who need a private knowledge base, or anyone who values privacy and control. A VPS provides the necessary flexibility and scalability for this type of application, allowing you to easily increase resources or add other services to the same server if needed.
What VPS configuration is needed for this task
Linkwarden is a relatively lightweight application, especially for individual use or a small team. However, the more links you save and the more frequently you use the page archiving feature (which saves full HTML and media), the more resources will be required.
Minimum requirements (for 1-5 users, up to 1000 links):
- CPU: 1 vCPU (modern processor, e.g., Intel Xeon E5 or AMD EPYC).
- RAM: 2 GB (for stable operation of Docker, Linkwarden, and the database).
- Disk: 40-60 GB SSD (for the operating system, Docker images, Linkwarden database, and archived pages. SSD significantly speeds up operation).
- Network: 100 Mbps (sufficient for most tasks if there is no intensive upload/download of archived data).
Recommended configuration (for 5-20 users, up to 10000 links or active archiving):
- CPU: 2 vCPU.
- RAM: 4 GB.
- Disk: 80-120 GB SSD (or NVMe for maximum performance).
- Network: 1 Gbps.
For renting a VPS with such characteristics, you can consider a VPS with the specified characteristics, suitable for most Linkwarden deployment tasks.
When a dedicated server is needed, not a VPS
A dedicated server may be required if:
- You plan to use Linkwarden for a very large team (hundreds of users).
- You will archive a huge number of pages (terabytes of data), which requires significant storage volumes and high I/O speed.
- Other resource-intensive services will be hosted on the server in addition to Linkwarden.
- You need maximum performance and isolation that a VPS cannot provide due to shared infrastructure.
- Specific hardware configurations are required that are not available on a VPS (e.g., RAID arrays, specialized network cards).
Location: what it affects
The choice of VPS location affects several factors:
- Latency: The closer the server is to you and your main users, the lower the latency and the faster the web interface response will be.
- Legal aspects: The legislation of the country where the server is located may affect privacy and data processing. Consider this if your data is sensitive.
- Network availability: In some regions, the network infrastructure is more developed and stable.
- Cost: VPS prices may vary depending on the region.
For most Linkwarden users, it is sufficient to choose a location that is geographically close to the main audience to ensure minimal latency.
Server preparation
Before installing Linkwarden, you need to perform basic security configuration and install the necessary utilities on your VPS. We will use Ubuntu 24.04 LTS (Noble Numbat) as the main operating system, as it is one of the most popular and well-supported platforms for servers.
Connect to your VPS via SSH using the credentials provided by your provider. This usually looks like this:
ssh root@ВАШ_IP_АДРЕС
1. System update
First, update the package list and installed packages to their latest versions.
sudo apt update # Update the list of available packages
sudo apt upgrade -y # Upgrade installed packages
sudo apt autoremove -y # Remove unnecessary packages
2. Creating a new user with sudo privileges
Working under the root account is unsafe. Create a new user and grant them sudo privileges.
sudo adduser linkwardenuser # Create a new user named linkwardenuser
sudo usermod -aG sudo linkwardenuser # Add the user to the sudo group
After creating the user, exit the root session and log in as the new user:
exit
ssh linkwardenuser@ВАШ_IP_АДРЕС
3. Configuring SSH keys (recommended)
For increased security, it is recommended to use SSH keys instead of passwords. If you don't have an SSH key yet, generate one on your local machine:
ssh-keygen -t rsa -b 4096 # Generate a new SSH key (on your local machine)
Then copy the public key to your VPS:
ssh-copy-id linkwardenuser@ВАШ_IP_АДРЕС # Copy the public key to the server
After this, you can disable password authentication in the /etc/ssh/sshd_config file by changing PasswordAuthentication yes to PasswordAuthentication no and restarting the SSH service. This will significantly enhance security.
4. Configuring the firewall (UFW)
Enable Uncomplicated Firewall (UFW) and allow only the necessary ports: SSH (22), HTTP (80), and HTTPS (443).
sudo apt install ufw -y # Install UFW if not installed
sudo ufw allow OpenSSH # Allow SSH connections
sudo ufw allow http # Allow HTTP (port 80)
sudo ufw allow https # Allow HTTPS (port 443)
sudo ufw enable # Enable the firewall
sudo ufw status # Check firewall status
Confirm activation by pressing 'y'.
5. Installing Fail2Ban
Fail2Ban helps protect the server from brute-force attacks by blocking IP addresses from which numerous failed login attempts occur.
sudo apt install fail2ban -y # Install Fail2Ban
sudo systemctl enable fail2ban # Enable Fail2Ban autostart
sudo systemctl start fail2ban # Start Fail2Ban
You can create a configuration file /etc/fail2ban/jail.local for fine-tuning, but the basic installation already provides good SSH protection.
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
Ensure that the [sshd] section is active (enabled = true).
6. Installing basic utilities
Install useful utilities that may come in handy during installation and debugging.
sudo apt install curl wget git htop unzip -y # Install curl, wget, git, htop, and unzip
Your server is now ready for Linkwarden installation.
Software Installation — Step-by-Step
Linkwarden is best deployed using Docker and Docker Compose, which provides isolation, portability, and ease of management. We will install Docker Engine and Docker Compose, and then deploy Linkwarden.
1. Installing Docker Engine (relevant for 2026)
For Ubuntu 24.04 LTS, it is recommended to install Docker from the official Docker repository.
# Remove old Docker versions, if any
for pkg in docker.io docker-doc docker-compose docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin; do sudo apt remove $pkg -y; done
# Install necessary packages to use the HTTPS repository
sudo apt update
sudo apt install ca-certificates curl gnupg -y
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Add the Docker repository to APT sources
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update the package list with the new repository
sudo apt update
# Install Docker Engine, Docker CLI, and Containerd (versions will be current for 2026, e.g., Docker 26.x)
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Add the current user to the docker group to avoid using sudo for docker commands
sudo usermod -aG docker $USER
# Apply group changes (you need to log out and log back into the SSH session)
# To do this, exit the current SSH session and log back in: exit, then ssh linkwardenuser@YOUR_IP_ADDRESS
After logging back into the SSH session, verify the Docker installation:
docker run hello-world # Run a test container to verify Docker installation
You should see the message "Hello from Docker!".
2. Installing Docker Compose (if not installed as a plugin)
Starting with Docker Engine 20.10, Docker Compose is included as a docker compose plugin. If you installed it using docker-compose-plugin, a separate installation is not required. You can check for its presence:
docker compose version # Check the Docker Compose plugin version (e.g., v2.24.x)
If the command docker compose version works, then Docker Compose is installed. If not, or if you prefer the old docker-compose syntax, install it separately:
# Download the current version of Docker Compose (e.g., 2.24.x for 2026)
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Grant execution permissions
sudo chmod +x /usr/local/bin/docker-compose
# Create a symbolic link (optional, for convenience)
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# Check the version
docker-compose --version # Check the Docker Compose version (e.g., Docker Compose version 2.24.5)
3. Creating a Directory for Linkwarden
Create a directory where Linkwarden configuration files will be stored.
mkdir ~/linkwarden # Create the linkwarden directory in the user's home folder
cd ~/linkwarden # Navigate to the created directory
4. Downloading the docker-compose.yml file
Linkwarden provides an official docker-compose.yml file. Download it.
wget https://raw.githubusercontent.com/linkwarden/linkwarden/main/docker-compose.yml # Download the docker-compose.yml file
Open the docker-compose.yml file for review. It will contain the linkwarden service (the application itself) and db (PostgreSQL database).
5. Creating the .env file
Create a .env file to store environment variables and secrets. This is the best way to manage configuration without modifying the main docker-compose.yml file.
nano .env # Create and open the .env file for editing
Insert the following content, changing the values to your own:
# Linkwarden Application Settings
# -----------------------------
# You MUST change the SECRET_KEY to a strong, random string.
# Generate one using openssl rand -base64 32 or similar.
SECRET_KEY=ВАШ_СЕКРЕТНЫЙ_КЛЮЧ_ЗДЕСЬ # Be sure to generate a unique key!
NEXTAUTH_URL=https://linkwarden.ВАШ_ДОМЕН.ru # The URL where Linkwarden will be accessible
# Database Settings (PostgreSQL)
# -----------------------------
# You MUST change POSTGRES_PASSWORD to a strong, random password.
POSTGRES_USER=linkwardenuser
POSTGRES_PASSWORD=ВАШ_ПАРОЛЬ_БАЗЫ_ДАННЫХ_ЗДЕСЬ # Be sure to generate a unique password!
POSTGRES_DB=linkwarden
# Docker Volumes for data persistence
# ----------------------------------
# These define where Linkwarden and PostgreSQL data will be stored on your host.
# Ensure these paths exist and Docker has permissions to write to them.
LINKWARDEN_DATA_DIR=./linkwarden_data
POSTGRES_DATA_DIR=./postgres_data
# Optional: Timezone for Linkwarden
# Find your timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=Europe/Moscow
# Optional: Enable email for account recovery, invitations etc.
# SMTP_HOST=smtp.your-email-provider.com
# SMTP_PORT=587
# [email protected]
# SMTP_PASSWORD=YOUR_EMAIL_PASSWORD
# SMTP_FROM=Linkwarden
Important:
- Replace
ВАШ_СЕКРЕТНЫЙ_КЛЮЧ_ЗДЕСЬwith a random string. You can generate one using the commandopenssl rand -base64 32. - Replace
ВАШ_ПАРОЛЬ_БАЗЫ_ДАННЫХ_ЗДЕСЬwith a strong, complex password. - Specify your domain in
NEXTAUTH_URL. - Ensure that
LINKWARDEN_DATA_DIRandPOSTGRES_DATA_DIRpoint to existing or will-be-created directories.
Save the file (Ctrl+X, Y, Enter).
6. Creating Data Directories
Create the directories specified in .env for storing Linkwarden and PostgreSQL data.
mkdir linkwarden_data # Create directory for Linkwarden data
mkdir postgres_data # Create directory for PostgreSQL data
7. Starting Linkwarden
You are now ready to start Linkwarden using Docker Compose.
docker compose up -d # Start Linkwarden and PostgreSQL services in the background
This command will download the necessary Docker images (linkwarden/linkwarden and postgres), create containers, and start them. The process may take several minutes depending on your internet connection speed.
8. Checking Container Status
Ensure that all containers are running correctly.
docker compose ps # Show status of running containers
You should see an Up status for both services. If any service has an Exited or Restarting status, check the logs:
docker compose logs linkwarden # View logs for the linkwarden container
docker compose logs db # View logs for the database container
At this stage, Linkwarden is running on your server but is only accessible via internal ports (usually 3000 for Linkwarden). To access it externally and ensure security, we will need to configure a reverse proxy with HTTPS.