Learn how to install Nextcloud on Ubuntu Server to create your own private cloud storage and collaboration platform. This guide from EcoStack Cloud provides step-by-step instructions for setting up Nextcloud securely and efficiently.
ubuntunextcloudprivatestorage
Nano
VPS
1
vCPU
1 GB
Memory
10 GB
NVMe Disk
512 GB
Traffic
2.90€
/month
* Up to 3GB RAM, 30GB NVMe Disk Space and 1Gbit/s Network Speed
#### Step 1: Update Your System
Ensure your Ubuntu Server is up-to-date before installing Nextcloud.
```bash
sudo apt update
sudo apt upgrade -y
```
#### Step 2: Install Required Dependencies
Install the necessary packages for Nextcloud.
```bash
sudo apt install apache2 mariadb-server libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip -y
```
#### Step 3: Secure MariaDB Installation
Run the MySQL/MariaDB secure installation script and follow the prompts to set up MariaDB securely.
```bash
sudo mysql_secure_installation
```
#### Step 4: Create Nextcloud Database
Log in to the MariaDB server.
```bash
sudo mysql -u root -p
```
Create a new database for Nextcloud.
```sql
CREATE DATABASE nextcloud;
```
Create a new user and grant privileges to the Nextcloud database.
```sql
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
```
#### Step 5: Download Nextcloud
Download the latest stable release of Nextcloud.
```bash
cd /tmp
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
```
Extract the downloaded archive.
```bash
sudo tar -xvjf latest.tar.bz2 -C /var/www/
```
#### Step 6: Set Permissions
Set the correct permissions for the Nextcloud directory.
```bash
sudo chown -R www-data:www-data /var/www/nextcloud/
```
#### Step 7: Configure Apache
Create a new virtual host configuration file for Nextcloud.
```bash
sudo nano /etc/apache2/sites-available/nextcloud.conf
```
Add the following configuration:
```
ServerAdmin admin@example.com
DocumentRoot /var/www/nextcloud/
ServerName your_domain.com
Options +FollowSymlinks
AllowOverride All
Require all granted
Dav off
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
```
Enable the Nextcloud virtual host.
```bash
sudo a2ensite nextcloud.conf
```
Restart Apache for the changes to take effect.
```bash
sudo systemctl restart apache2
```
#### Step 8: Complete Installation
Open your web browser and navigate to your server's domain or IP address.
```
http://your_domain.com
```
Follow the on-screen instructions to complete the Nextcloud installation.
#### Step 9: Set Up Admin Account
Create an admin account for Nextcloud.
#### Step 10: Enjoy Nextcloud
You're now ready to use Nextcloud as your private cloud storage and collaboration platform!
Congratulations! You have successfully installed Nextcloud on your Ubuntu Server. For more tutorials and cloud solutions, visit EcoStack Cloud.
------