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.
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.
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):
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:
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.
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.
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.
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!
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.
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.
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.
Thanks to Cendio/ThinLinc for sponsoring today’s video! Check out their awesome remote desktop solution here.
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.
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.
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.
Thanks to Netdata for sponsoring this tutorial. Check out Netdata to level-up infrastructure monitoring!
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.
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!