NextCloud

From The World according to Vissie
Jump to navigation Jump to search

Setup NextCloud 18

I had to upgrade my verstion of php to 7.3

https://www.itzgeek.com/how-tos/linux/debian/how-to-install-php-7-3-7-2-7-1-on-debian-10-debian-9-debian-8.html

sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https
wget https://packages.sury.org/php/apt.gpg
sudo apt-key add apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
sudo apt update
sudo apt-get install php7.3 php7.3-cli php7.3-common php7.3-fpm php7.3-json php7.3-intl php-imagick php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php-pear php7.3-bcmath
sudo update-alternatives --set php /usr/bin/php7.3
php -v
sudo apt install -y php7.3-fpm
sudo apt install -y php7.3-mysql
sudo systemctl stop nginx.service
sudo systemctl stop php7.0-fpm.service
sudo systemctl start php7.3-fpm.service
sudo systemctl start nginx.service

Setup older NextCloud

Some links

https://www.marksei.com/how-to-install-nextcloud-13-on-ubuntu/

https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html

https://websiteforstudents.com/install-nextcloud-on-ubuntu-16-04-lts-with-apache2-mariadb-php-7-1-and-lets-encrypt-ssl-tls/

Next cloud 17

https://computingforgeeks.com/how-to-install-nextcloud-on-ubuntu-debian/

My install

sudo apt install nginx

Next, run the commands below to stop, start and enable Nginx service to always start up with the server boots.

sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service

Next, install Maria DB

sudo apt-get install mariadb-server mariadb-client

After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

After that, run the commands below to secure MariaDB server.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]:  Y 
New password:  Enter Password 
Re-enter new password:  Repeat password 
Remove anonymous users? [Y/n]:  Y 
Disallow root login remotely? [Y/n]:  Y 
Remove test database and access to it? [Y/n]:  Y 
Reload privilege tables now? [Y/n]:  Y 

Restart MariaDB server

sudo systemctl restart mariadb.service

NextCloud also requires PHP to function. To install PHP and related modules run the commands below

sudo apt install php-fpm php-mbstring php-xmlrpc php-soap php-apcu php-smbclient php-ldap php-redis php-gd php-xml php-intl php-json php-imagick php-mysql php-cli php-mcrypt php-ldap php-zip php-curl

Run the commands below to logon to the database server. When prompted for a password, type the root password you created above.

sudo mysql -u root -p

Then create a database called nextcloud

CREATE DATABASE nextcloud;

Create a database user called nextclouduser with new password

CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;
mkdir -p ~/src/nextloud
#cd ~/src/nextloud && wget https://download.nextcloud.com/server/releases/nextcloud-15.0.2.zip
cd ~/src/nextloud && wget https://download.nextcloud.com/server/releases/latest-17.zip
unzip ./latest-17.zip
sudo mv nextcloud /var/www/html/nextcloud/

Then run the commands below to set the correct permissions for NextCloud to function.

sudo chown -R www-data:www-data /var/www/html/nextcloud/
sudo chmod -R 755 /var/www/html/nextcloud/

After configuring the VirtualHost above, enable it by running the commands below

sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/

To load all the settings above, restart Nginx by running the commands below.

sudo systemctl restart nginx.service

Get a cert for your site if needed

sudo certbot certonly --standalone -d site.me.com

To load all the settings above, restart Nginx by running the commands below.

sudo systemctl restart nginx.service

Then open your browser and browse to the server domain name followed by install. You should see NextCloud setup wizard to complete. Please follow the wizard carefully.

http://example.com

Tip's

If you copy file over, do: cd /var/www/nextcloud

sudo -u www-data php console.php files:scan --all
or use webDAV
https://docs.nextcloud.com/server/9/user_manual/files/access_webdav.html

Clients:

https://nextcloud.com/install/#install-clients