
NextCloud is an open-source self-hosted cloud storage server and workspace tool. Its extensive plug-in community offers solutions for most file-hosting and collaborative needs.
Install unzip.
Install the server dependencies.
Install the PHP dependencies.
Verify php7.4-fpm is installed.
Start and enable php7.4-fpm.
Verify php7.4-fpm is running.
Verify MySQL is installed.
Start and enable MySQL to run on boot.
Verify MySQL is running.
Enter MySQL console as a root user.
Create a new database called nextcloud.
Create a new privileged user inside the nextcloud database. Replace username with a username and password with a strong password of your choice.
NextCloud uses this user to authenticate a connection with MySQL.
Exit MySQL.
Verify Nginx is installed.
Start and enable Nginx to run on boot.
Verify Nginx is running.
Download the latest release of NextCloud to /var/www/.
Change directory to /var/www/ and extract latest.zip.
After extracting,
latest.zipis no longer required. You may delete it.
Change the ownership of the NextCloud folder.
Change directory to /etc/nginx/sites-available/ and delete the default Nginx server block.
Create and edit a new Nginx server block.
Add the following server configuration to the file.
Create server block link of nextcloud in sites-enabled.
Restart Nginx for the changes to take effect.
Navigate to your server's IP address in a web browser.
You should see a setup page asking to Create an admin account. Enter a username and a strong password of your choice for the main admin account.
Inside the Storage & database section, the field for Data Folder is /var/www/nextcloud/data.
Under the Configure the database section, enter the username and password created in Step 6 during the Database Setup.
The Database name field is nextcloud, and Database host is localhost.
Finally, click the Install button at the end of the form. NextCloud redirects to the dashboard when it finishes installing.
Installing may take several minutes to complete depending on server specifications.
A cache can improve NextCloud's performance by allowing faster access to assets.
Install Redis® and the php-redis module.
Verify Redis® installed.
Start and enable Redis® to run on boot.
Verify Redis® is running.
Change directory to /etc/redis/ and edit redis.conf.
Uncomment unixsocket and unixsocketperm. Change unixsocketperm to 770.
Restart Redis®.
Add www-data to the redis group.
Change directory to /var/www/nextcloud/config/ and edit config.php.
Append the following configuration parameters to the $CONFIG array.
Restart php7.4-fpm to apply changes.
NextCloud should now be using Redis® as a cache.
A secure connection to NextCloud ensures encrypted communication. This is crucial for production servers exposed to the internet to maximize security.
Change directory to /etc/nginx/sites-available/ and edit nextcloud.
At the bottom of the file, add the following server block code. Replace example.com with your domain.
At the top of the file, add the following configuration in the original server block. Replace example.com with your domain.
In the same server block, under the location ~ \.php(?:$|/) block, add the fastcgi_param HTTPS on; module. It should look like the following.
Restart Nginx to apply changes.
NextCloud should now be communicating through HTTPS.
You should have a working NextCloud server. For more information, refer to the official NextCloud documentation.
0 Comments
Be the first to comment and share your perspective with the community.