Self-Hosting a Lightweight Forum with Discourse or Flarum

Self-Hosting a Lightweight Forum with Discourse or Flarum Introduction Self-hosting a forum is a great way to build an online community while maintaining control over data and customization. Discourse and Flarum are two popular open-source forum platforms, each catering to different needs. This guide walks you through setting up either Discourse or Flarum on your server. Step 1: Choosing Between Discourse and Flarum Discourse: A feature-rich forum that requires Docker and PostgreSQL. ...

March 17, 2025

Using Rclone to Sync Files Across Multiple Cloud Providers

Using Rclone to Sync Files Across Multiple Cloud Providers Introduction Rclone is a powerful command-line tool that allows you to sync and manage files across different cloud storage providers such as Google Drive, Dropbox, OneDrive, and AWS S3. This guide will walk you through installing Rclone, configuring remote storage, and performing file synchronization. Step 1: Installing Rclone Download and install Rclone: curl https://rclone.org/install.sh | sudo bash Verify the installation: rclone version Step 2: Configuring a Remote Cloud Provider Start the configuration process: rclone config Select “New remote” and enter a name for your storage (eg. “gdrive”). ...

March 17, 2025

Deploying a Lightweight Virtual Desktop Environment on Your Server

Deploying a Lightweight Virtual Desktop Environment on Your Server Introduction A lightweight virtual desktop environment allows you to remotely access a graphical interface on your server without consuming excessive resources. This guide covers setting up Xfce, a minimal yet functional desktop environment, along with a VNC server for remote access. Step 1: Installing Xfce Desktop Environment Update your system packages: sudo apt update && sudo apt upgrade -y Install the Xfce desktop environment: sudo apt install xfce4 xfce4-goodies -y Verify the installation by running: xfce4-session Step 2: Setting Up a VNC Server Install TigerVNC server: sudo apt install tigervnc-standalone-server -y Create a new VNC password: vncpasswd Start the VNC server for the first time: vncserver -geometry 1920x1080 Stop the server to configure startup scripts: vncserver -kill :1 Edit the VNC startup script ~/.vnc/xstartup and add: #!/bin/bash xrdb $HOME/.Xresources startxfce4 & Make the script executable: chmod +x ~/.vnc/xstartup Step 3: Configuring VNC as a Systemd Service Create a new service file: sudo nano /etc/systemd/system/[email protected] Add the following configuration: [Unit] Description=Start VNC server at startup After=syslog.target network.target [Service] Type=forking User=youruser PAMName=login PIDFile=/home/youruser/.vnc/%H:1.pid ExecStart=/usr/bin/vncserver :1 -geometry 1920x1080 -depth 24 ExecStop=/usr/bin/vncserver -kill :1 [Install] WantedBy=multi-user.target Reload systemd and enable the service: sudo systemctl daemon-reload sudo systemctl enable [email protected] sudo systemctl start [email protected] Step 4: Connecting to Your Virtual Desktop Use an SSH tunnel for secure access: ssh -L 5901:localhost:5901 [email protected] Open a VNC client (e.g., TigerVNC or RealVNC) and connect to: localhost:5901 Enter your VNC password and start using the remote desktop. Conclusion By following this guide, you can set up a lightweight virtual desktop environment on your server, enabling remote graphical access while maintaining efficient resource usage. For enhanced security, consider using SSH tunneling or restricting VNC access via firewall rules.

March 17, 2025

Securing Your Self-Hosted Email Server: SPF, DKIM, and DMARC Explained

Securing Your Self-Hosted Email Server: SPF, DKIM, and DMARC Explained Introduction Running a self-hosted email server comes with security challenges, including preventing email spoofing and phishing attacks. SPF, DKIM, and DMARC are essential email authentication methods that help protect your domain from misuse. This guide walks you through setting up these security measures. Step 1: Understanding SPF (Sender Policy Framework) SPF helps prevent email spoofing by specifying which mail servers are allowed to send emails on behalf of your domain. ...

March 17, 2025

How to Monitor Server Uptime with Prometheus and Grafana

How to Monitor Server Uptime with Prometheus and Grafana Introduction Monitoring server uptime is crucial for maintaining a reliable infrastructure. Prometheus, an open-source monitoring system, and Grafana, a visualization tool, can be combined to track uptime and display real-time metrics in an intuitive dashboard. This guide walks you through setting up Prometheus and Grafana for uptime monitoring. Step 1: Install Prometheus Update your system and install dependencies: sudo apt update && sudo apt install -y wget tar Download and extract Prometheus: wget https://github.com/prometheus/prometheus/releases/latest/download/prometheus-linux-amd64.tar.gz mkdir -p ~/prometheus && tar -xvf prometheus-linux-amd64.tar.gz -C ~/prometheus --strip-components=1 Navigate to the Prometheus directory: cd ~/prometheus Start Prometheus: ./prometheus --config.file=prometheus.yml Step 2: Configure Prometheus to Monitor Uptime Open the Prometheus configuration file: nano ~/prometheus/prometheus.yml Add the following job to scrape uptime metrics: scrape_configs: job_name: 'node_exporter' static_configs: targets: ['localhost:9100'] Save the file and restart Prometheus. Step 3: Install Node Exporter Download and install Node Exporter: wget https://github.com/prometheus/node_exporter/releases/latest/download/node_exporter-linux-amd64.tar.gz mkdir -p ~/node_exporter && tar -xvf node_exporter-linux-amd64.tar.gz -C /node_exporter --strip-components=1 Start Node Exporter: /node_exporter/node_exporter & Verify that Node Exporter is running by accessing http://localhost:9100/metrics in a browser. Step 4: Install and Configure Grafana Install Grafana using the official repository: wget https://dl.grafana.com/oss/release/grafana_10.0.0_amd64.deb sudo dpkg -i grafana_10.0.0_amd64.deb sudo systemctl enable --now grafana-server Access Grafana at http://localhost:3000 and log in with admin / admin. ...

March 17, 2025

Running a Minimalist Linux Server: Alpine vs Debian vs Ubuntu

Running a Minimalist Linux Server: Alpine vs Debian vs Ubuntu Introduction When setting up a lightweight Linux server, choosing the right distribution can make a significant difference in performance, security, and ease of management. In this guide, we’ll compare three popular options—Alpine, Debian, and Ubuntu—focusing on their suitability for a minimalist server setup. Alpine Linux: Ultra-Lightweight and Secure Minimal Footprint: Alpine is designed to be small, with an installation size of just a few megabytes. ...

March 17, 2025

Using Fail2Ban with Cloudflare for Enhanced DDoS Protection

Using Fail2Ban with Cloudflare for Enhanced DDoS Protection Introduction Fail2Ban is a powerful tool that helps protect Linux servers from brute-force attacks by banning suspicious IPs. When combined with Cloudflare, you can further mitigate DDoS attacks by blocking abusive IPs at the network edge before they even reach your server. This guide will walk you through configuring Fail2Ban to update Cloudflare’s firewall rules automatically. Step 1: Install Fail2Ban Update your system and install Fail2Ban: sudo apt update && sudo apt install -y fail2ban Enable and start the Fail2Ban service: sudo systemctl enable --now fail2ban Step 2: Get Your Cloudflare API Token Log in to your Cloudflare dashboard. ...

March 17, 2025

Deploying a Self-Hosted Pastebin with PrivateBin

Deploying a Self-Hosted Pastebin with PrivateBin Introduction PrivateBin is a self-hosted, open-source pastebin that allows users to share text and code snippets securely. Unlike public pastebin services, PrivateBin encrypts data client-side, ensuring privacy. This guide will walk you through setting up PrivateBin on a Linux server. Step 1: Install Required Dependencies Update your package list: sudo apt update && sudo apt upgrade -y Install Apache or Nginx and PHP: sudo apt install -y apache2 php php-fpm php-xml php-json php-mbstring unzip Step 2: Download and Configure PrivateBin Navigate to the web directory: cd /var/www Download the latest PrivateBin release: sudo wget https://github.com/PrivateBin/PrivateBin/archive/refs/heads/master.zip Extract the archive and rename the folder: sudo unzip master.zip && mv PrivateBin-master privatebin Set proper permissions: sudo chown -R www-data:www-data /var/www/privatebin Configure PrivateBin settings: sudo nano /var/www/privatebin/cfg/conf.php Modify the settings as needed, then save and exit. ...

March 17, 2025

Automating Firewall Rules with UFW and Cron Jobs

Automating Firewall Rules with UFW and Cron Jobs Introduction Uncomplicated Firewall (UFW) is a user-friendly frontend for managing iptables on Linux. Automating firewall rules with cron jobs allows dynamic security adjustments, such as enabling specific ports during certain times or blocking unwanted connections periodically. This guide will walk you through automating UFW with cron jobs. Step 1: Install and Enable UFW Install UFW if it’s not already installed: sudo apt install -y ufw Enable UFW and allow SSH access: sudo ufw allow OpenSSH sudo ufw enable Step 2: Create Custom Firewall Rules Add rules to allow or deny specific traffic. Example: Allowing HTTP traffic: sudo ufw allow 80/tcp Denying a specific IP: sudo ufw deny from 192.168.1.100 Step 3: Automate Firewall Rules with Cron Jobs Open the cron job editor: crontab -e Add a rule to block SSH access every night from midnight to 6 AM: 0 0 * * * sudo ufw deny OpenSSH 0 6 * * * sudo ufw allow OpenSSH Save and exit the editor. Step 4: Verify and Monitor Firewall Rules Check the current firewall rules: sudo ufw status verbose Monitor firewall logs in real-time: sudo tail -f /var/log/ufw.log Conclusion Automating firewall rules using UFW and cron jobs enhances security while providing flexibility in managing access. Regularly reviewing firewall logs and rules ensures your system remains protected against unauthorised access.

March 17, 2025

Hardening SSH Security: Best Practices for Securing Remote Access

Hardening SSH Security: Best Practices for Securing Remote Access Introduction SSH (Secure Shell) is a fundamental tool for managing remote servers, but it is also a common target for brute force attacks and exploits. Properly securing SSH access is crucial for protecting your infrastructure. This guide covers best practices to harden SSH security on your Linux server. Step 1: Disable Root Login Open the SSH configuration file: sudo nano /etc/ssh/sshd_config Find the following line: PermitRootLogin yes Change it to: PermitRootLogin no Save the file and restart SSH: sudo systemctl restart ssh Step 2: Change the Default SSH Port Open the SSH configuration file: sudo nano /etc/ssh/sshd_config Find the line that specifies the port (usually port 22): #Port 22 Change it to a non-standard port, e.g.: Port 2222 Restart SSH to apply changes: sudo systemctl restart ssh Step 3: Use SSH Key Authentication Generate an SSH key pair on your local machine: ssh-keygen -t rsa -b 4096 Copy the public key to the server: ssh-copy-id -p 2222 [email protected] Disable password authentication in /etc/ssh/sshd_config: PasswordAuthentication no Restart SSH: sudo systemctl restart ssh Step 4: Limit SSH Access to Specific Users Open the SSH configuration file: sudo nano /etc/ssh/sshd_config Add the following line at the end: AllowUsers myuser Restart SSH to apply changes: sudo systemctl restart ssh Step 5: Enable Two-Factor Authentication (2FA) for SSH Install the Google Authenticator PAM module: sudo apt install -y libpam-google-authenticator Run the setup for your user: google-authenticator Follow the prompts and scan the QR code with your 2FA app. ...

March 17, 2025