How to Deploy Nextcloud for Private Cloud Storage in Your HomeLab

Nextcloud is an open-source platform for private cloud storage and collaboration. By hosting Nextcloud in your homelab, you can securely store files, manage calendars, and sync data across devices—all without relying on third-party services. This guide walks you through installing and configuring Nextcloud on your homelab server. What You’ll Need A server or virtual machine with at least: 2 GB RAM and 1 CPU (for small deployments). 20 GB of storage (or more for large file collections). Linux installed (Ubuntu 20.04 or newer is recommended). A static IP or domain name. Step 1: Update and Prepare Your Server Log into your server: ssh user@<server_ip> Update the system packages: sudo apt update && sudo apt upgrade -y Install necessary dependencies: sudo apt install -y apache2 mariadb-server libapache2-mod-php php php-mysql php-xml php-mbstring php-curl php-zip php-gd unzip Step 2: Set Up the Database Secure MariaDB: sudo mysql_secure_installation Follow the prompts to set a root password and remove unnecessary settings. ...

2024-12-04 · 3 min

Self-Hosting GitLab: A Guide to Version Control in Your HomeLab

Self-hosting GitLab in your homelab allows you to manage code repositories, CI/CD pipelines, and collaborative development projects in a secure, private environment. This guide walks you through installing and configuring GitLab on your homelab server. What You’ll Need A server or virtual machine with at least: 4 GB RAM and 2 CPUs (recommended for smaller deployments). 20 GB of storage (more for large repositories or CI/CD). A Linux-based OS (Ubuntu 20.04 or newer is recommended). A static IP or domain name (for remote access). Step 1: Update and Prepare Your Server Log into your server: ssh user@<server_ip> Update the system packages: sudo apt update && sudo apt upgrade -y Install dependencies: sudo apt install -y curl openssh-server ca-certificates Step 2: Install GitLab Add the GitLab repository: curl -s [https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh](https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh) | sudo bash Install GitLab: Replace <your-domain> with your server’s domain or IP: sudo EXTERNAL_URL="http://<your-domain>" apt install -y gitlab-ee Run the GitLab reconfiguration script: sudo gitlab-ctl reconfigure Step 3: Access the GitLab Web Interface Open your web browser and go to http://<your-domain>. Set a password for the default root user on the first login. Log in using the root username and your new password. Step 4: Configure GitLab Set up email notifications: Edit the /etc/gitlab/gitlab.rb file and configure SMTP settings. Reconfigure GitLab: sudo gitlab-ctl reconfigure Create a new project: Navigate to the Projects tab in the web interface. Click New Project and follow the wizard to create your repository. Step 5: Connect to Your Repository Clone the repository to your local machine: git clone http://<your-domain>/<namespace>/<repository>.git Push your code to the repository: cd <repository> git add . git commit -m "Initial commit" git push origin main Step 6: Enable SSL (Optional) Install Certbot for Let’s Encrypt: sudo apt install -y certbot Generate an SSL certificate: sudo certbot certonly --standalone -d <your-domain> Update GitLab configuration: Edit /etc/gitlab/gitlab.rb: external_url "https://<your-domain>" nginx['ssl_certificate'] = "/etc/letsencrypt/live/<your-domain>/fullchain.pem" nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/<your-domain>/privkey.pem" Reconfigure GitLab: sudo gitlab-ctl reconfigure Step 7: Configure CI/CD Pipelines (Optional) Add a .gitlab-ci.yml file to your repository root: yaml stages: - build build-job: stage: build script: - echo "Hello, World!" Commit and push the file: git add .gitlab-ci.yml git commit -m "Add CI/CD pipeline" git push origin main 2. Check the CI/CD > Pipelines section in the GitLab web interface to monitor the job.: FAQs Q: Is GitLab free to use? A: Yes, GitLab offers a free tier with all essential features for self-hosting. Paid tiers include advanced features like enhanced security and analytics. ...

2024-12-04 · 3 min