In today’s digital age, bookmarking services have become an essential tool for organizing and accessing online content. While there are many bookmarking services available, hosting your own service gives you complete control over your data and ensures faster and more reliable access. One such self-hosted bookmarking service is Linkding. In this comprehensive guide, we will walk you through the process of installing and configuring Linkding on AlmaLinux 8 using Docker. So, let’s dive in and get started.
Prerequisites
Before we begin with the installation process, make sure you have the following prerequisites in place:
- A system with AlmaLinux 8 installed and running.
- Root access to the system.
- Docker installed and running. If you haven’t installed Docker yet, you can refer to our guide on installing Docker on AlmaLinux 8.
Now that you have all the prerequisites ready, let’s proceed with the installation and configuration of Linkding.
Step 1: Install Nginx
The first step is to install Nginx, which will act as a reverse proxy for Linkding. To install Nginx, run the following commands:
yum install nginx -y
systemctl enable nginx
systemctl start nginx
systemctl status nginx
Step 2: Enable Firewall
Next, we need to enable the firewall to allow HTTP and HTTPS traffic. Run the following commands to enable the necessary services:
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --reload
Step 3: Install Let’s Encrypt SSL Certificate
To secure your Linkding installation with SSL, we will use Let’s Encrypt to issue an SSL certificate. Follow the steps below to install the required packages and generate the SSL certificate:
- Install the EPEL repository and the mod_ssl package:
dnf install epel-release mod_ssl -y
- Install the certbot client:
dnf install python3-certbot-nginx -y
- Issue the Let’s Encrypt SSL certificate:
certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email dev@dev.domainhere.info -d dev.domainhere.info
Please replace dev.domainhere.info
and dev@dev.domainhere.info
with your domain name and email address.
Step 4: Configure Nginx Server Blocks
Now, let’s configure Nginx server blocks to route traffic to Linkding. Open the Nginx configuration file using the command:
nano /etc/nginx/nginx.conf
Replace the contents of the file with the following configuration:
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; }
Save the changes by pressing Ctrl+O
and then Ctrl+X
.
Next, create a new Nginx configuration file for your domain using the command:
vi /etc/nginx/conf.d/dev.conf
Add the following configuration to the file:
upstream app { server 192.169.7.180:9090; } server { listen 80 default_server; server_name dev.domainhere.info; return 301 https://$server_name$request_uri; } server { listen 443 ssl; # managed by Certbot server_name dev.domainhere.info; ssl_certificate /etc/letsencrypt/live/dev.domainhere.info/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dev.domainhere.info/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { proxy_pass http://app; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header X-Real-Port $server_port; proxy_set_header X-Real-Scheme $scheme; } }
Save the changes by pressing Esc
, then :wq!
, and finally pressing Enter
.
For SELinux enabled systems, run the following command to allow Nginx to make network connections:
setsebool -P httpd_can_network_connect 1
Restart Nginx to apply the changes:
systemctl restart nginx systemctl status nginx
Step 5: Enable Port 9090
To allow connection to the Linkding application, we need to enable port 9090. Run the following commands to allow incoming traffic on port 9090:
firewall-cmd --zone=public --permanent --add-port 9090/tcp firewall-cmd --reload
Step 6: Install Linkding with Docker
Finally, it’s time to install Linkding using Docker. Run the following command to install Linkding with Docker:
docker run --name linkding -p 9090:9090 -v /data:/data -d sissbruecker/linkding:latest
The installation process may take a few minutes to complete.
Step 7: Adding Super User Setup
To access the Linkding application, you need to create a superuser account. Replace the values in the following command with your desired username and email address, and then run the command:
docker exec -it linkding python manage.py createsuperuser --username=shapehost --email=dev@dev.domainhere.info
Follow the prompts to set a secure password for the superuser account.
Step 8: Accessing Linkding
Congratulations! You have successfully installed Linkding with Docker on AlmaLinux 8. Now, open your web browser and enter the IP address or domain name associated with your server. For example:
https://dev.domainhere.info
Replace dev.domainhere.info
with your actual IP address or domain name.
You can now log in to the Linkding application using the superuser credentials you created earlier.
Conclusion
Setting up your own bookmarking service with Linkding on AlmaLinux 8 is a straightforward process when using Docker. By following the steps outlined in this guide, you have successfully installed and configured Linkding to create a personalized and secure bookmarking experience. Enjoy the convenience and control that self-hosted bookmarking provides.
For more information about Shape.host’s cloud hosting services, including Cloud VPS options, visit Shape.host.