Install Ubuntu

Install Ubuntu Server the way you like. Only one minor change. When you come to the Software Selection Screen, I recommend setting up the LAMP, Standard System Utilities, and OpenSSH Server options as displayed below.

Tasksel

After your reboot, go ahead and let the updates run…

apt update
apt upgrade

To get the most receent version, visit the NextCloud.com website, and click “Download” in the upper right corner. In the next page under where it says Get Server, click the Download button again.

It will open a little Popup window. On the “Archive” tab, right click on the tar.bz2 file and copy the link, and then use wget to download it to your server:

1) Use Wget…

wget https://download.nextcloud.com/server/releases/nextcloud-10.0.1.tar.bz2

2) Extract the archive and copy the folder contentsto /var/www/html

tar -jxvf nextcloud-10.0.1.tar.bz2
sudo cp -Rv nextcloud/* /var/www/html/

3) Activate the necessary apache modules:

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime

4) Install some necessary PHP modules

sudo apt install php-zip php-mbstring php-ctype mcrypt php-xml php-curl php-gd

5) Set Apache as the owner of the files…

chown -R www-data:www-data /var/www/html/*

6) Ensure that the DirectoryIndex has index.php as the first item in the line in /etc/apache2/mods-enabled/dir.conf

sudo nano /etc/apache2/mods-enabled/dir.conf
sudo systemctl restart apache2

7) Delete the original index.html and Run the Install Wizard

sudo rm /var/www/html/index.html

9) Create a MySQL User and database for NextCloud… Enter your root password when prompted.

mysql -u root -p
create database nextcloud;
grant all on nextcloud.* to cloud identified by 'next!';
flush privileges;
exit;

Test the login… (use the password for the cloud user that you specified in the ‘identified by’ above)

mysql -u cloud -p

If you are able to log in, continue. If not, go back and start step 9 over again.

10) HTTP to the IP address of your nextclout server ie: http://192.168.128.107/

You should be presented with a page that asks you to create an admin account and for more information, such as data folder, and database user, and password… Fill the information out.

Form to fill out

Ideally, you will use more secure usernames and passwords… But after you have it filled out, click the ‘Finish Setup’ button.

If everything was successful, it will take you to the user interface.

It is HIGHLY recommended that you configure SSL for your next cloud server, or place your Nextcloud server behind an NGinx proxy confgiured with SSL.