2 Ways To Install NextCloud on Ubuntu 18.04 LTS / Ubuntu 17.10
NextCloud is an open source file synchronization and sharing solution, the fork of ownCloud. It is like a Google Drive / Dropbox that permits you to store and share your documents, pictures, and videos in a centralized location.
Apache 2.4 with mod_php
NextCloud Enterprise is also available with full enterprise support, including phone and email access to Nextcloud developers.
- Access your files anywhere.
- Share your files with the others and protect the public links with a password.
- Supports Two-factor authentication
- Tracking changes to your files.
- Access files stored in external cloud storage service providers such as Amazon, Google, and Dropbox.
Install NextCloud on Ubuntu 18.04 / Ubuntu 17.10
You can install Nextcloud on Ubuntu using Snap or LAMP stack.
Method 1: Install Nextcloud using snap
You can easily install Nextcloud using the Snap command.
sudo snap install nextcloud
The Nextcloud installation may take few minutes to complete. Verify the Nextcloud installation using the below command.
sudo snap list nextcloud
Name Version Rev Tracking Developer Notes nextcloud 13.0.2snap1 6916 stable nextcloud -
Open a browser and navigate it to Nextcloud URL.
Create an admin account then click Finish setup.
You will now get the home page of Nextcloud where you can upload or download your documents.
Method 2: Install Nextcloud using LAMP stack
We will install the necessary PHP extension for NextCloud.
sudo apt update sudo apt install -y php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-sqlite3
Now, we will install Apache web server and MariaDB server for Nextcloud.
sudo apt install -y apache2 mariadb-server libapache2-mod-php
Apache Modules (Must):
You need to enable few modules to get NextCloud work properly.
sudo a2enmod rewrite
You can also enable additional Apache modules.
sudo a2enmod headers sudo a2enmod dir sudo a2enmod env sudo a2enmod mime
Restart the Apache service.
sudo systemctl restart apache2
NextCloud offers you the zipped archives for server admin’s to download and manually set it up on top of a LAMP stack.
cd /tmp/ wget https://download.nextcloud.com/server/releases/latest.tar.bz2 tar -jxvf latest.tar.bz2 sudo mv nextcloud /var/www/html/ sudo mkdir /var/www/html/nextcloud/data
Update the ownership of files inside the NextCloud root directory so that web server can write data into it.
sudo chown -R www-data:www-data /var/www/html/nextcloud/
Create MySQL Database
If you are setting up a MariaDB server for the first time, then
Ensure MariaDB server service is running.
Log in to MariaDB server using the root user to create a database.
sudo mysql -u root -p
Create a database called “nextclouddb”
create database nextclouddb;
Grant “nextclouduser” to access the “nextclouddb” database on localhost with a password “password“.
grant all on nextclouddb.* to 'nextclouduser'@'localhost' identified by 'password';
Exit from the MariaDB prompt.
Open a web browser and navigate to it Nextcloud setup.
Fill up the setup page with admin information for creating an admin account and the location of the data folder.
You can choose either SQLite or MySQL. If you decided to use SQLite database, then you do not have to enter database details. Using SQLite server in a production environment is not recommended, so, we will use MariaDB here.
Enter the database details in the below page.
Alternately, you can download the NextCloud clients available for Desktop, Android, and iOS to sync documents across your devices.
Install NextCloud on Ubuntu 18.04 using LAMP Stack – Nextcloud AppsOn the home page of NextCloud. Clicking “+ sign” button and then Upload to begin uploading the files.