All Content

  • Self-Host Nextcloud on Debian: The Ultimate Step-by-Step Build Guide

    Set up your own Nextcloud server on Debian — from scratch! In this step-by-step tutorial, I’ll walk you through the complete installation process, including server preparation, database setup, Apache configuration, PHP tuning, performance tweaks, securing your cloud with Let’s Encrypt (and more). Whether you’re hosting files for personal use, your business, or a homelab, this guide covers everything you need to build a fast, secure, and reliable Nextcloud instance.

    You’ll learn how to create a cloud server, configure MariaDB, optimize PHP settings, fix missing indices, enable Redis for speed, and properly secure your deployment. No skipped steps — just a full, detailed setup walkthrough you can follow with confidence.

    YouTube player
    Read more: Self-Host Nextcloud on Debian: The Ultimate Step-by-Step Build Guide

    Video Notes

    The following sections contain notes, commands, and config files that were used during this video.

    What you’ll need

    To have the best experience, you’ll need the following:

    A Linux server

    You’ll need a Linux server for this project. You can use a physical server, virtual machine, or cloud instance. In the video, a Linode instance is used on Akamai’s cloud platform. If you want to follow along exactly, you’ll need to create a Linode instance. Otherwise, you can “translate” what’s being done in the video to your chosen platform.

    Also, Debian 13 “Trixie” is used for the build within the video. Nextcloud can be set up on just about any distribution, but if you don’t choose Debian, then you’ll have to search for alternatives for some of the steps as package names and individual commands change per distro.

    Note: This video was NOT sponsored by Akamai/Linode (or anyone else for that matter). While Linode has sponsored Learn Linux TV in the past, they are not currently a sponsor. Linode was chosen only because I already have an account on the platform.

    Domain name

    While you can use Nextcloud without a domain name, it’s highly recommended that you use one. You can use your favorite domain registrar to register a domain if you don’t already have one.

    Note: After you create your Debian server, be sure to add its IP address to your DNS provider to ensure your instance is reachable by its name.

    Randomly Generated passwords

    Feel free to generate some random passwords ahead of time to use for your build. You’ll need a randomly generated password for each of the following:

    • Debian root user
    • MariaDB root user
    • Nextcloud database
    • Nextcloud admin user

    Install updates

    The first thing you should do is install all available updates, and it’s important to always do this once you set up any Linux server for the first time.

    First, update the package repository index:

    apt update

    Once that’s done, install any updates that might be available:

    apt dist-upgrade

    Update hostname

    Next, update the hostname of your Linux server to reflect the domain name you decided to use for your build. The fully qualified domain name that was used in the video was nc.learnlinux.cloud (which was used only for the recording, it doesn’t exist now – just replace it with yours).

    Update the /etc/hostname file to reflect your chosen name:

    nano /etc/hostname

    Also, update the /etc/hosts file to reflect your chosen name:

    nano /etc/hosts

    For example, you might add an entry that looks similar to this:

    127.0.1.1  nc.learnlinux.cloud  nc

    Create a non-root user

    If you don’t already have a standard user account, be sure to add one (it’s not a good idea to continually use the root account). The following command was used to create user jay within the video:

    adduser jay

    Next, add your user to the sudo group to ensure you can run privileged commands:

    usermod -aG sudo jay

    Note: Be sure to replace jay with your chosen username.

    Reboot

    Reboot the server so that it takes advantage of all of the updates:

    sudo reboot

    Set up MariaDB

    For this build, MariaDB was used to provide the required database layer.

    Install MariaDB:

    To install MariaDB, run the following command:

    sudo apt install mariadb-server mariadb-client-compat

    Check the status:

    Run the following command to ensure MariaDB is running:

    systemctl status mariadb

    If it’s not, use the following command which will ensure it’s running and also enabled (meaning it will start at boot):

    sudo systemctl enable --now mariadb

    Implement basic security:

    Since MariaDB is a big target for threat actors, we need to secure it. The following command will prompt you for various things to provide minimum security:

    sudo mysql_secure_installation

    Create a database for Nextcloud:

    Next, we’ll create the actual database that Nextcloud will end up using. To create it, enter the MariaDB shell:

    sudo mariadb

    Then, create the database:

    CREATE DATABASE nextcloud;

    Make sure it was actually created (it should appear in the list):

    SHOW DATABASES;

    Next, we’ll need to ensure Nextcloud will have access to its database. The following command will create a “user grant” that Nextcloud will use:

    GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'mypassword';

    Finally, exit the MariaDB shell to return back to the normal command prompt:

    exit

    Install Apache

    For this build, Apache will serve as the web server for Nextcloud. Install these packages (Apache will be installed automatically as a dependency):

    sudo apt install imagemagick-7.q16 php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml

    Check to make sure Apache is running:

    systemctl status apache2

    Test Apache

    Visit your URL in your browser to make sure the default page loads, you should see the default Apache start page,

    Install Nextcloud

    At this point, we’ll install some additional dependencies and then copy Nextcloud’s files to the server.

    Install required packages:

    The following packages are required for Apache to be able to serve Nextcloud properly:

    sudo phpenmod apcu bcmath gmp imagick intl unzip

    Download Nextcloud:

    Next, download Nextcloud’s latest release file to the server (requires the wget package be installed):

    wget https://download.nextcloud.com/server/releases/latest.zip

    Unzip Nextcloud:

    We’ll need to use the unzip comand to extract files from the downloaded archive (the unzip package will need to be installed for this to work):

    unzip latest.zip

    Remove the Nextcloud zip file:

    We won’t need latest.zip anymore, so feel free to remove it if you don’t plan on using it again:

    rm latest.zip

    Move the Nextcloud directory to the appropriate place:

    Rename the extracted Nextcloud directory to match your server’s FQDN (optional but recommended):

    mv nextcloud nc.learnlinux.cloud

    Change ownership for the Nextcloud directory so that Apache will have access to it:

    sudo chown -R www-data:www-data nc.learnlinux.cloud


    Next, move your Nextcloud directory into the /var/www directory:

    sudo mv nc.learnlinux.cloud /var/www/

    Disable the default Apache site:

    Next, you can disable the default Apache start page since we won’t be needing it:

    sudo a2dissite 000-default.conf

    Apache Virtual Host Configuration

    Next, we’ll create a config file that will instruct Apache how to serve Nextcloud.

    Create the config file:

    sudo nano /etc/apache2/sites-available/nc.learnlinux.cloud.conf

    Add the following to the file:

    <VirtualHost *:80>
    DocumentRoot "/var/www/nc.learnlinux.cloud"
    ServerName nc.learnlinux.cloud

    <Directory "/var/www/nc.learnlinux.cloud/">
    Options MultiViews FollowSymlinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    TransferLog /var/log/apache2/nc.learnlinux.cloud_access.log
    ErrorLog /var/log/apache2/nc.learnlinux.cloud_error.log

    </VirtualHost>

    Enable the new config file:

    sudo a2ensite nc.learnlinux.cloud.conf

    Set PHP settings

    Edit the PHP config file so we can adjust some settings:

    sudo nano /etc/php/8.4/apache2/php.ini

    Set the following parameters:

    memory_limit = 512M
    upload_max_filesize = 200M
    max_execution_time = 360
    post_max_size = 200M
    date.timezone = America/Detroit
    opcache.enable=1
    opcache.interned_strings_buffer=16
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

    Enable required modules for Apache:

    sudo a2enmod dir env headers mime rewrite ssl

    Enable Caching:

    Open the apcu.ini file in an editor:

    sudo nano /etc/php/8.4/mods-available/apcu.ini

    Add the following to the end of the file:

    apc.enable_cli=1

    Restart Apache to apply our changes so far:

    sudo systemctl restart apache2

    Set up Nextcloud

    To apply the initial configuration, visit your Nextcloud site and answer the questions. You’ll be asked for a password for the admin user, database name, and database password. Add that information, and Nextcloud will be installed!

    Post Install: Tweak Nextcloud Database

    Although we just ran through the installer, there’s a few things Nextcloud doesn’t do on a fresh install. To implement these tweaks, first mark the occ script executable (be sure to update the path to match yours):

    sudo chmod +x /var/www/nc.learnlinux.cloud/occ

    Run the following command to add missing databases indices:

    sudo /var/www/nc.learnlinux.cloud/occ db:add-missing-indices

    Update mimetypes as well:

    sudo /var/www/nc.learnlinux.cloud/occ maintenance:repair --include-expensive

    Remove execution bit from occ to increase security:

    sudo chmod -x /var/www/nc.learnlinux.cloud/occ

    Post Install: Update config file permissions

    The following commands will increase security for the config file:

    Set ownership:

    sudo chown root:www-data /var/www/nc.learnlinux.cloud/config/config.php

    Set permissions:

    sudo chmod 660 /var/www/nc.learnlinux.cloud/config/config.php

    Post Install: Enable Caching

    To enable caching, first edit the Nextcloud config file:

    sudo nano /var/www/nc.learnlinux.cloud/config/config.php

    Add to the file:

    'memcache.local' => '\\OC\\Memcache\\APCu',
    'default_phone_region' => 'US',

    Post Install: Set up Let’s Encrypt

    To set up a certificate for encryption, we’ll first install Certbot:

    sudo apt install python3-certbot-apache

    Apply a certificate to your site:

    sudo certbot --apache -d nc.learnlinux.cloud

    To fully benefit from our certificate, enable strict transport security:

    sudo nano /etc/apache2/sites-available/nc.learnlinux.cloud-le-ssl.conf

    Add to the config file:

    <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>

    Post Install: : Install Redis

    Redis is optional, but can add performance benefits. To install it:

    sudo apt install redis-server php-redis

    Edit the Redis config file:

    sudo nano /etc/redis/redis.conf

    change: Port 6379 to 0

    Uncomment: unixsocket /run/redis/redis-server.sock

    Uncomment: unixsocketperm 700 (change to 770)

    Add the www-data user to the redis group:

    sudo usermod -aG redis www-data

    Edit the Nextcloud config file to use Redis:

    sudo vim /var/www/nc.learnlinux.cloud/config/config.php

    Add the following to the file:

      'filelocking.enabled' => true,
    'memcache.locking' => '\\OC\\Memcache\\Redis',
    'redis' =>
    array(
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
    ),

    Restart Apache to apply our final changes:

    sudo systemctl restart apache2
  • How to Install Fedora 43 Step-by-Step

    Installing Fedora 43? In this step-by-step tutorial, I’ll walk you through the entire installation process — from creating the bootable USB, to testing Fedora in Live Mode, to completing the full install on your PC. Whether you’re switching from Windows or upgrading your Linux setup, this Fedora 43 guide makes the process clear, beginner-friendly, and frustration-free.

    You’ll learn how to download Fedora 43 safely, prepare installation media, explore the Live Environment, start the installer, and finish the post-install setup. If you’re new to Fedora or Linux, this video will help you get up and running confidently.

    YouTube player
  • Linux & AI in 2025: Benefits & Risks You Must Know

    Artificial Intelligence is changing everything — from how we work to how we manage servers — but what does AI actually mean for Linux users, system administrators, and technical professionals? In this in-depth talk, I break down what AI really is, how it works, where it helps (and hurts), and how Linux fits into the rapidly evolving AI landscape.

    YouTube player
  • Fedora 43 Review — Still the Best GNOME Distro?

    Fedora 43 is here, and in this review I’ll show you what’s new, what’s improved, and whether this release is worth upgrading to. We’ll explore the latest GNOME 49 desktop, installation process, and my honest impressions after hands-on testing.

    YouTube player
  • Ubuntu 25.10 Setup — From Download to Desktop

    In this video, I’ll guide you through the complete process of installing Ubuntu 25.10 from start to finish. You’ll learn how to download the latest Ubuntu release, create a bootable USB drive, test it in Live Mode, and complete the installation step by step.

    This tutorial is perfect for beginners who are installing Ubuntu for the first time, as well as experienced users who want a quick refresher. Ubuntu 25.10 includes GNOME 49, Linux kernel 6.17, and a fully Wayland-based desktop for improved performance and modern hardware support. By the end of this video, you’ll have Ubuntu 25.10 up and running on your system!

    YouTube player
  • 10 Things I Wish I Knew About Linux (All Things Open 2025)

    What are some things that might make life easier for new Linux users and administrators? In this video, Jay talks about ten things he wish he knew when he first started. This video is a recording of a speech he gave at All Things Open 2025 in Raleigh, NC.

    YouTube player
  • Ubuntu 25.10 — What’s New in This Release

    Ubuntu 25.10 Questing Quokka is here. In this review, we take a deep dive into the latest Ubuntu release and explore what’s new, including GNOME 49, Linux kernel 6.17, and the full migration to Wayland. From installer updates and performance improvements to desktop polish and quality of life tweaks, Ubuntu 25.10 brings major changes to the Linux desktop experience.

    Whether you’re new to Linux, a developer, or a DevOps professional, this release has something worth exploring. In this video, I walk through the new features, share my honest impressions, and help you decide if Ubuntu 25.10 is worth upgrading to or installing fresh.

    YouTube player
  • Install and Configure ThinLinc Cluster on Linux – Full Guide

    Learn how to set up and configure a ThinLinc cluster on Linux in this complete step-by-step tutorial. This guide covers everything from downloading the ThinLinc server package to configuring master and agent nodes for a fully functional remote desktop cluster.

    YouTube player

    Thanks to Cendio/ThinLinc for sponsoring today’s video! Check out their awesome remote desktop solution here.

  • Will It Run Linux? GMKTec NucBox K12 Full Review

    Looking for a powerful Mini PC? In this video, I review the GMKTec NucBox K12, a compact computer that packs a punch. I’ll test its Linux compatibility, explore how it handles real-world workloads, and see if it’s strong enough to serve as a homelab server or lightweight workstation.

    YouTube player

    If you’d like to purchase a NucBox K12 for yourself, consider using this affiliate link to help support the channel.

    Thanks to ThinLinc for sponsoring today’s video!

    Check out ThinLinc, an awesome and easy to use solution that provides remote access to your Linux desktop. Check it out here.

    Note: ThinLinc is not affiliated with GMKTec.

  • How Netdata’s Awesome AI Features Adds Fantastic Value for SysAdmins

    Discover the power of Netdata AI in this in-depth overview! 🚀 In this video, we explore how Netdata’s built-in artificial intelligence transforms infrastructure monitoring by summarizing system health, explaining alerts, detecting anomalies, and troubleshooting issues in real time. You’ll see practical examples of Netdata AI in action, plus a sneak peek at upcoming features that will make monitoring faster and smarter.

    Whether you’re a Linux system administrator, DevOps engineer, or just curious about AI-driven monitoring tools, this tutorial will show you how Netdata AI can simplify infrastructure management and help you respond to alerts more effectively.

    YouTube player

    Thanks to Netdata for sponsoring this tutorial. Check out Netdata to level-up infrastructure monitoring!

  • Linux Crash Course: How To Use “who” And “w” Commands

    Learn the difference between the Linux who and w commands in this step-by-step tutorial. Both commands are used to check who is logged into a Linux system, but they display information in different ways. In this video, you’ll see clear examples of how to use the who command to view logged-in users, and how the w command gives you more detailed information about user sessions and activity.

    This Linux command line guide is perfect for beginners who want to understand system monitoring basics and for anyone looking to strengthen their Linux skills. Whether you’re working with servers, desktops, or just learning the Linux terminal, you’ll walk away knowing how to use who and w effectively.

    YouTube player
  • Big Data Explained: Everything You Need To Know

    What is Big Data and why does it matter? In this video, we’ll break down the concept of Big Data in plain English so you can finally understand what the buzzword actually means. From how mankind processes massive amounts of information, to how Big Data pipelines work and the different types of infrastructure that make it possible, this explainer will give you a clear picture of one of the most important topics in tech today. Whether you’re a beginner curious about data, a student learning the basics, or just someone who wants to know what “Big Data” really is — this video is for you.

    Thanks to OpenMetal for sponsoring today’s video! Check them out to see how they can assist you with your Big Data goals!

    YouTube player