Linkding is a simple, yet flexible web-based bookmark manager for Linux. Similar to offline bookmark managers, it allows you to create and annotate the web links that you have accumulated over time.
This article will show you how you can install Linkding on an Ubuntu 22.04 machine using Docker and Docker Compose. It will also highlight how you can create and manage a non-admin user inside your new Linkding instance.
Why Host Your Own Bookmark Manager using Linkding?
One of the biggest selling points of Linkding is that you can quickly deploy it on an existing server and use it within a few minutes. This means that you don’t need to provision a new machine, physical or otherwise, to host your own bookmark manager.
Linkding also extends the basic features found in most bookmark managers to include link sharing and multi-user mode. This makes it ideal for users who want to create a private collaborative platform for sharing links between a group.
Obtaining Linkding and Docker Compose
To deploy Linkding, you need to first install Docker along with its Docker Compose component. You can do that by fetching the program’s signing key from the developer’s website:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg
Create a new repository file for your Docker installation:
sudo nano /etc/apt/sources.list.d/docker.list
Paste the following line of code inside your new repository file:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable
Reload your system’s package repositories by running the following command:
sudo apt update && sudo apt upgrade sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin nginx
Obtaining and Deploying the Linkding Docker Container
Create a new folder for Linkding inside your home directory and go inside it:
mkdir ~/linkding && cd ~/linkding
Use your favorite text editor to create an empty “docker-compose.yml” file:
nano ./docker-compose.yml
Paste the following block of code inside your new compose file:
--- version: "3" services: linkding: container_name: ${LD_CONTAINER_NAME:-linkding} image: sissbruecker/linkding:latest ports: - ${LD_HOST_PORT:-9090}:9090 volumes: - ${LD_HOST_DATA_DIR:-./data}:/etc/linkding/data env_file: - .env restart: unless-stopped
Save your new docker-compose.yml, then create an environment file for your instance. This will contain all the custom variables for your new installation:
nano ~/linkding/.env
Paste the following block of code inside your new environment file:
LD_CONTAINER_NAME="linkding" LD_HOST_PORT="9090" LD_HOST_DATA_DIR="./data" LD_SUPERUSER_NAME="linkding" # CHANGE WITH A SECURE USERNAME LD_SUPERUSER_PASSWORD="linkding" # CHANGE WITH A SECURE PASSWORD LD_DISABLE_BACKGROUND_TASKS="False" LD_DISABLE_URL_VALIDATION="False" LD_ENABLE_AUTH_PROXY="False" LD_CSRF_TRUSTED_ORIGINS="https://linkding.your-domain-name.here"
Lastly, build your new Docker Container by running the following command:
docker compose up -d
Creating an Nginx Reverse Proxy for SSL
At this point, you now have a working instance of Linkding running on port 9090. However, to be able to access it publicly, you need to create a reverse proxy that will secure incoming connections using SSL.
Create a new site config file for your instance:
sudo nano /etc/nginx/sites-available/linkding
Paste the following block of code inside your new site file:
server { listen 80; listen [::]:80; root /var/www/html; server_name linkding.your-domain-name.here; location / { proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:9090; } }
Remove the default site config file and create a symbolic link for your new config file to “/etc/nginx/sites-enabled”:
sudo rm /etc/nginx/default sudo ln -s /etc/nginx/sites-available/linkding /etc/nginx/sites-enabled/linkding
Start and enable your Nginx daemon to apply its new settings:
sudo systemctl restart nginx sudo systemctl enable --now nginx
Enabling SSL for Your Linkding Instance
Ensure that your machine has the most recent core snap binary:
sudo snap install core
Install the Electronic Frontier Foundation’s (EFF) Certbot snap package:
sudo snap install certbot --classic
Test whether your certbot installation is working properly by registering it to the EFF:
sudo certbot register --agree-tos -m ramces@email.invalid
Request for an SSL certificate for your instance by running the following command:
sudo certbot --nginx -d linkding.your-domain-name.here
Test whether your new instance is both secure and working by loading its address on a web browser.
Creating a New User in Linkding
Login to your new Linkding instance using the superuser credentials that you’ve provided in your “.env” file.
Click the “Settings” link on the page’s upper right corner.
Click the “Admin” tab on Linkding’s settings page. This will bring up the Linkding Administrator Panel.
To add a new user, click the “Add” link beside the Users row under the “Authentication and Authorization” category.
Provide a username and a password for your new Linkding user, then click “Save” to activate your new user.
Test whether your new user is working properly by logging in to it through a different browser session.
Disabling an Existing User in Linkding
To disable an existing user in Linkding, go to your instance’s administrator panel, then select the “Users” link under the “Authentication and Authorization” category.
Click the username that you want to disable. This will load the profile for that particular user.
Scroll down to the “Permissions” category, then uncheck the checkbox beside the “Active” label.
Scroll down to the bottom of the page then click “Save” to fully disable the user.
Frequently Asked Questions
Can you install Linkding without using Docker?
No. The developers of Linkding designed it to only work with Docker containers. This is because the program has a number of co-dependencies that need to be deployed in a specific order and a specific way in order to work properly.
Is it possible to import existing bookmarks to Linkding?
Yes. It is possible to import a list of bookmarks from other external bookmark managers. For example, you can copy over your bookmarks from both Google Chrome and Microsoft Edge directly to Linkding.
Is it possible to backup the Linkding database outside Docker?
Yes. There are two ways to back up a Linkding database from its Docker container. First, you can go to the Settings page, then go to the “Export” category under the “General” tab. Under that, click the “Download” button to back up the bookmarks of the current user.
Second, you can login to your Linkding server and copy the “db.sqlite3” file in the “~/linkding/data” directory. The advantage of this approach over the former is that the “db.sqlite3” file contains the entire bookmark database for the entire instance.
Image credit: Lauren Mancke via Unsplash (Background) Linkding Github (Logo). All alterations and screenshots by Ramces Red.
Our latest tutorials delivered straight to your inbox