How to Install Nextcloud 25 On Ubuntu 20.04 With PHP 7.4



Nextcloud offers a cutting edge, on-premises content joint effort stage with continuous record altering, video visit and groupware on versatile, work area and web.

My Spesification Server Lab on virtualbox

OS               : UBUNTU 20.04
Hard Disk    : 80 GB
RAM           :  2 GB
Hostname    : svr-cloud
IP Address   : 192.168.1.20/24

Change hostname

hostnamectl set-hostname svr-cloud


Reboot Server

reboot


Login to your server again

Check ufw status

ufw status

Status: inactive

Enable ufw (for secure)

ufw enable


if putty, disconnect, login again or restart your putty

ufw status


give permission for OpenSSH

ufw allow OpenSSH && ufw reload

Change IP Address static

nano /etc/netplan/00-installer-config.yaml
===================================================
# This is the network config written by 'subiquity'
network:
    ethernets:
        enp0s17:
            addresses: [192.168.1.80/24]
            gateway4: 192.168.1.1
            nameservers:
              addresses: [8.8.8.8,8.8.4.4]
            dhcp4: no
    version: 2
====================================================

Apply Netplan

netplan apply


install software-properties-common, which adds management for additional software sources:

apt -y install software-properties-common


install the repository ppa:ondrej/php, which will give you all your versions of PHP

add-apt-repository ppa:ondrej/php


press enter

Update and upgrade

apt update -y && apt upgrade -y

Install Apache, MariaDB, PHP and other PHP extensions to your server

apt-get install apache2 mariadb-server apache2 php7.4 php7.4-gd php7.4-json php7.4-mysql php7.4-curl php7.4-mbstring php7.4-intl php7.4-imagick php7.4-xml php7.4-zip libapache2-mod-php7.4 unzip wget -y

Check PHP Version

php -v
PHP 7.4.33 (cli) (built: Nov  8 2022 11:33:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies



Config apache.conf

nano /etc/apache2/sites-available/000-default.conf
============================================
## type nextcloud on DocumentRoot

## DEFAULT : DocumentRoot /var/www/html/

## CHANGE : DocumentRoot /var/www/html/nextcloud/

## Config php.ini

nano /etc/php/7.4/apache2/php.ini

=============================
file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 100M
display_errors = Off
date.timezone = Asia/Jakarta
=============================
press ctrl + x

start Apache and MariaDB service and enable them to start on system reboot

systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb

Configure database

mysql -u root -p
===================================================================
CREATE DATABASE nextclouddb;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'P@ssw0rd';
GRANT ALL ON nextclouddb.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'P@ssw0rd' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
===================================================================
Download nextcloud latest version

cd

wget https://download.nextcloud.com/server/releases/nextcloud-25.0.2.zip

unzip nextcloud-25.0.2.zip -d /var/www/html/

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

nano /etc/apache2/sites-available/nextcloud.conf

==========================================================
<VirtualHost *:80>
ServerAdmin admin@agl.net
DocumentRoot /var/www/html/nextcloud/
ServerName 192.168.1.20
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
==========================================================
## enable virtual host file and other required modules

a2ensite nextcloud.conf
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime


## restart Apache service to apply all the configuration changes

systemctl restart apache2

give port 80 access to ufw

ufw allow 20

ufw reload



Access NextCloud Web Interface

http://192.168.1.20



                                                           
Watch the video
 






Comments

Popular posts from this blog

How to Install Zabbix 6.0 LTS on Ubuntu 22

How to Install Nagios 4.4.9 On ubuntu 22.04

How To Install Nextcloud 25 On Red Hat 8.6 With PHP 7.4