Ubuntu: Set up Nextcloud - how it works
You can also set up your own Nextcloud on your Ubuntu server. We show you how this works in this practical tip.
Set up Nextcloud on Ubuntu - so go ahead
- Go to this page and copy the link of the latest version. Make sure it is a ".tar.bz2" archive.
- Connect to your server via SSH and change to the temporary directory with "cd / tmp".
- Download the latest version using "curl -LO //download.nextcloud.com/server/releases/nextcloud-11.0.3.tar.bz2".
- Unzip the archive with "sudo tar -C / var / www -xvjf /tmp/nextcloud-11.0.3.tar.bz2 to start the installation.
- Use "nano /tmp/nextcloud.sh" to create a shell script and add the following: "#! / Bin / bash ocpath =" / var / www / nextcloud "htuser =" www-data "htgroup = "www-data" rootuser = "root" printf "Creating possible missing Directories \ n" mkdir -p $ ocpath / data mkdir -p $ ocpath / assets mkdir -p $ ocpath / updater printf "chmod Files and Directories \ n" find $ {ocpath} / -type f -print0 | xargs -0 chmod 0640 find $ {ocpath} / -type d -print0 | xargs -0 chmod 0750 chmod 755 $ {ocpath} printf "chown directories \ n" chown -R $ {rootuser}: $ {htgroup} $ {ocpath} / chown -R $ {htuser}: $ {htgroup} $ {ocpath} / apps / chown -R $ {htuser}: $ {htgroup} $ {ocpath} / assets / chown -R $ {htuser}: $ {htgroup} $ {ocpath} / config / chown -R $ {htuser}: $ {htgroup} $ {ocpath} / data / chown -R $ {htuser}: $ { htgroup} $ {ocpath} / themes / chown -R $ {htuser}: $ {htgroup} $ {ocpath} / updater / chmod + x $ {ocpath} / occ printf "chmod / chown .htaccess \ n" if [- f $ {ocpath} /. htaccess] then chmod 0644 $ {ocpath} /. htaccess chown $ {rootuser}: $ {htgroup} $ {ocpath} / .htaccess fi if [-f $ {ocpath} /data/.htaccess] then chmod 0644 $ {ocpath} /data/.htaccess chown $ {rootuser}: $ {htgroup} $ {ocpath} /data/.htaccess fi ",
- Then run the script with "sudo bash /tmp/nextcloud.sh". This creates all the necessary directories and provides them with the appropriate rights.
- To ensure that the server also runs on your Linux server, create another config file with "sudo nano /etc/apache2/sites-available/nextcloud.conf" and add the following there: "Alias / nextcloud" / var / www / nextcloud / "Options + FollowSymlinks AllowOverride All Dav off SetEnv HOME / var / www / nextcloud SetEnv HTTP_HOME / var / www / nextcloud". With the help of "sudo a2ensite nextcloud" this script is then applied.
- Now create the required module with "sudo a2enmod rewrite" and update the server with "sudo apt-get update". Also download the PHP module with "sudo apt-get install php-bz2 php-curl php-gd php-imagick php-intl php-mbstring php-xml php-zip" and then start the server with "sudo systemctl reload apache2 "new.
Set up Nextcloud on Ubuntu - further configuration
- In the next step you log into the MySQL administration with "mysql -u root -p".
- Then use "CREATE DATABASE nextcloud;" the database for Nextcloud.
- For security, only the user "nextcloud" should be able to access the MySQL administration. Define this with "GRANT ALL ON nextcloud. * To 'nextcloud' @ 'localhost' IDENTIFIED BY 'DATENBANK_PASSWORT';" and change "DATENBANK_PASSWORT" with a password of your choice.
- Load the MySQL configuration with "FLUSH PRIVILEGES;" new and exit "exit" the MySQL administration.
- Open your browser and enter your IP or web address and add "/ nextcloud" at the end.
- Now you have to configure the cloud. First enter a user name and the password for your administrator account.
- Then click on "Storage and data" and enter the MySQL data that you specified earlier.
- With a click on "Finish setup" the setup is successfully completed.
If you have your server in operation, you should update the Nextcloud regularly. We will show you this in our next practical tip.