Linkding is a powerful and customizable bookmark service that allows you to host your own bookmarking platform. It provides a minimalistic, fast, and easy-to-set-up solution, making it an excellent choice for individuals and businesses looking to manage their bookmarks efficiently. In this article, we will guide you through the process of installing Linkding on Rocky Linux 8 using Docker, ensuring a seamless and hassle-free experience.
Prerequisites
Before we dive into the installation process, let’s ensure that we have all the necessary prerequisites in place. Here’s what you’ll need:
- A system with Rocky Linux 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 Rocky Linux 8.
With these prerequisites met, we can now proceed with the installation and configuration of Linkding.
Step 1: Install Nginx
To begin, we need to install Nginx, a popular web server that will act as a reverse proxy for our Linkding installation. Follow the steps below to install Nginx:
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 required 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 our Linkding installation with SSL, we will use Let’s Encrypt, a free and widely trusted certificate authority. Follow the steps below to install the Let’s Encrypt 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 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 own domain name and email address. The SSL certificate will be automatically renewed every 90 days.
- Restart Nginx to apply the changes:
systemctl restart nginx
Step 4: Configure Nginx Server Blocks
Now, let’s configure the Nginx server blocks to ensure proper routing to our Linkding installation. Follow the steps below:
- Open the Nginx configuration file:
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 and exit the file by pressing
Ctrl+O, thenCtrl+X. - Create a new Nginx configuration file for Linkding:
vi /etc/nginx/conf.d/dev.conf
- Add the following configuration to the
dev.conffile:
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 and exit the file by pressing
Esc, then:wq!, and pressingEnter. - If SELinux is enabled on your system, run the following command:
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 access to Linkding through the firewall, we need to enable port 9090. Run the following commands:
firewall-cmd --zone=public --permanent --add-port9090/tcp firewall-cmd --reload
Step 6: Install Linkding with Docker
Finally, it’s time to install Linkding using Docker. Docker allows us to easily manage and deploy applications in isolated containers. Follow the steps below to install Linkding with Docker:
- Run the following command to install Linkding:
docker run --name linkding-p9090:9090 -v /data:/data -d sissbruecker/linkding:latest
The installation process may take a few minutes to complete. Once finished, Linkding will be up and running on port 9090.
Step 7: Adding Super User Setup
To access and manage the Linkding application, we need to create a superuser account. Run the following command, replacing the username and email address with your desired credentials:
docker exec-it linkding python manage.py createsuperuser --username=username --email=email@example.com
Follow the prompts to set a secure password for the superuser account. Once done, you can log in to the Linkding UI using your credentials.
Step 8: Accessing Linkding
Now that Linkding is installed and configured, you can access it through your web browser. Open the IP address or domain name associated with your Rocky Linux 8 server, followed by port 9090. For example:
https://dev.domainhere.info
Replace dev.domainhere.info with your actual IP address or domain name. You will be redirected to the Linkding interface, where you can start managing your bookmarks.
Congratulations! You have successfully installed Linkding with Docker on Rocky Linux 8. Enjoy the benefits of hosting your own bookmarking service and stay organized with ease.
If you’re looking for reliable and scalable cloud hosting solutions, be sure to check out Shape.host. They provide Linux SSD VPS services with exceptional performance and 24/7 customer support, helping businesses thrive in the digital landscape.