Installing and deploying Next Cloud on Debian 11 from scratch and adding it to an Active Director...

Опубликовано: 30 Август 2026
на канале: Heavily Armed Nerd
7,805
159

Nextcloud is a suite of client-server programs for creating and using data storage. Nextcloud can be installed on either a hosted service or a private server. Its available functionality is similar to Dropbox.

Unlike proprietary services like Dropbox, Nextcloud's open architecture allows for server functionality to be added as applications, giving users complete control over their data.


Installation is straightforward, requiring no prior Linux knowledge. A minor problem is integrating NextCloud into a domain.
Authorization of domain users, a short chat test.


As promised, all the commands used in the video are below, along with a brief description.

================
nano /etc/hostname (change it to your hostname)
nano /etc/hosts (127.0.1.1 nxc.heavilyarmednerd.local)
--
wget https://download.nextcloud.com/server...
-
sudo apt install mariadb-server
udo mysql_secure_installation (secure installation)
current root password DB skip
Set root password Y (enter)
Add new password for DB
remove anon user Yes
Disallow root login remotely YES
Remove test databases? Yes
remove privilege tables yes
sudo mariadb (we're inside the database, there are different commands)
CREATE DATABASE nxcdb;

SHOW DATABASES

GRANT ALL PRIVILEGES ON nxcdb.* TO 'nxcdbuser'@'localhost' IDENTIFIED BY 'Aa123456789!'; (Create a user in the DP with the specified password and grant them these privileges)
FLUSH PRIVILEGES;
cntl + D to disconnect from the database
-
sudo apt install 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
After this, Apache should be running (you can access it in a browser using its IP address and check).

systemctl status apache2 (check Apache's status)
systemctl status mariadb (check Maria's status)
-
Enable and edit the PHP modules we need for operation (we'll enable PHP ldap at the end).
sudo phpenmod bcmath gmp imagick intl
or
apt install php-imagick
apt install php-bcmath
apt install php-intl
apt install php-gmp
-
which unzip (check if we have the unxip program; if not, install it with sudo apt install unzip)
mv nextcloud nxc.heavilyarmednerd.local
sudo chown -R www-data:www-data nxc.heavilyarmednerd.local/ (grant privileges to the Apache user)
apt t install apache2 libapache2-mod-wsgi python-dev
sudo a2dissite 000-default.conf
systemctl reload apache2
Now we need to unzip the Next Cloud files we downloaded
unzip nextcloud-23.0.0.zip
sudo nano /etc/apache2/sites-available/nxc.heavilyarmednerd.local.conf
(Unfortunately, some configs couldn't be pasted here due to comment restrictions) YouTube)
-
sudo nano /etc/php/7.4/apache2/php.ini
ctrl+w search
cntrl+o save
cntr+x exit

memory_limit = 512M
upload_max_filesize = 200M
max_execution_time = 360
post_max_size = 200M
date.timezone = Asia/Baku
opcache.enable=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
--
sudo a2enmod dir env headers mime rewrite ssl
-
Next Cloud should already be running and prompting for authorization. Let's go to it and we'll complete the initial setup (create an admin account).

Now it's almost ready.

Go and edit another file (it's only created after you log in for the first time through the web interface).

sudo vim /var/www/nxc.heavilyarmednerd.local/config/config.php

Paste the APCU settings. I couldn't paste them here due to restrictions on brackets and special characters.
sudo chmod 660 /var/www/nxc.heavilyarmednerd.local/config/config.php
sudo chown root:www-data /var/www/nxc.heavilyarmednerd.local/config/config.php
-
Settings Administration overview. If you have index errors there, do the following:
sudo php /var/www/nxc.heavilyarmednerd.local/occ db:add-missing-indices

Adds packages for LDAP and domain user connections.
sudo apt install php-ldap module
sudo systemctl restart apache2

Then everything is as in the video: add the user for LDAP and connect.