Cara Install Nextcloud Server di CentOS 7
Artikel ini saya tulis sebagai dokumentasi setelah mengikuti KULGRAM #05 Komunitas GNU/Linux Malang (KLiM) yang dibawakan oleh pak Nur Hamim. Materi yang dibahas pada kulgram kali ini adalah Nextcloud. Nextcloud adalah aplikasi open source yang dapat digunakan untuk membuat cloud storage atau penyimpanan data di mana anda dapat menyimpan berbagai macam ekstensi data ataupun file statik seperti halnya file music, video, dan sebagainya. Secara fungsi Nextcloud hampir sama seperti Google Drive atau Dropbox, bahkan Nextcloud juga dapat dimanfaatkan untuk berbagai macam kepetingan dan kebutuhan misalnya video conference antar pengguna Nextcloud dan masih banyak lainnya.
0. Requirement
Nextcloud yang akan diinstall adalah versi 14, jadi requirement yang digunakan juga untuk versi 14.
Operating System
- Ubuntu 16.04/18.04 LTS (recommended)
- Red Hat Enterprise Linux 7 (recommended)
- Debian 8 (Jessie), 9 (Stretch)
- SUSE Linux Enterprise Server 11 with SP3 & 12
- openSUSE Leap 42.1+
- CentOS 7
Database
- MySQL or MariaDB 5.5+ (recommended)
- Oracle Database 11g (only as part of an enterprise subscription)
- PostgreSQL 9/10
- SQLite (only recommended for testing and minimal-instances)
Web Server
- Apache 2.4 with mod_php or php-fpm (recommended)
- nginx with php-fpm
PHP Runtime
- 7.0
- 7.1
- 7.2
Memory
Nextcloud minimum membutuhkan RAM 128MB, direkomendasikan minimum 512MB.
Desktop Client
Direkomendasikan menggunakan sistem operasi terbaru.
- Windows 7+
- macOS Lion (10.7)+ (64-bit only)
- Linux (CentOS 6.5+, Ubuntu 14.04+, Fedora 21+, openSUSE 13, SUSE Linux Enterprise 11 SP3+, Debian 8 (Jessie)+, Red Hat Enterprise Linux 7)
Mobile Apps
Direkomendasikan menggunakan sistem operasi mobile terbaru.
- iOS 9.x+
- Android 4.x+
Web Browser
Direkomendasikan menggunakan web browser terbaru.
- Microsoft Internet Explorer 11 (latest version)
- Microsoft Edge
- Mozilla Firefox
- Google Chrome/Chromium
- Apple Safari
1. Install Paket Pendukung
Update system
1 | yum update -y |
Install paket dependensi
1 | yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2 |
2. Apache Web Server
Install Apache
1 | yum install httpd -y |
Buat konfigurasi virtual host
1 | nano /etc/httpd/conf.d/nextcloud.conf |
1 2 3 4 5 6 7 8 9 10 | <VirtualHost *:80> DocumentRoot /var/www/html/nextcloud ServerName namadomain.com <Directory "/var/www/html/"> Require all granted AllowOverride All Options FollowSymLinks MultiViews </Directory> </VirtualHost> |
ServerName bisa pasang IP server, nama domain, atau sub domain.
Kemudian jalankan service httpd (apache)
1 2 3 | systemctl start httpd systemctl enable httpd systemctl status httpd |
3. PHP Engine
Selanjutnya install repository webtatic untuk instalasi PHP 7.2
1 | rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm |
Install PHP 7.2
1 2 3 | yum install -y php72w php72w-cli php72w-common php72w-curl php72w-gd \ php72w-mbstring php72w-mysqlnd php72w-process php72w-xml php72w-zip \ php72w-opcache php72w-pecl-apcu php72w-intl php72w-pecl-redis |
4. MariaDB Database
Install database MariaDB
1 | yum install mariadb-server -y |
Jalankan service mariadb
1 2 3 | systemctl start mariadb systemctl enable mariadb systemctl status mariadb |
Konfigurasi awal MariaDB
1 | mysql_secure_installation |
Jawab pertanyaan konfigurasi
1 2 3 4 5 6 | Enter current password for root (enter for none): enter Change the root password? [Y/n] y 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 |
Login ke MariaDB
1 | mysql -u root -p |
Buat database dan usernya
1 2 3 4 5 6 7 8 9 10 11 12 13 | MariaDB [(none)]> create database nextcloud; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> create user 'usernextcloud'@'localhost' identified by 'passwordnya-nextcloud'; Query OK, 0 rows affected (0.04 sec) MariaDB [(none)]> grant all privileges on nextcloud.* to 'usernextcloud'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit |
5. Nextcloud
Download Nextcloud
1 | wget https://download.nextcloud.com/server/releases/nextcloud-14.0.4.zip |
Extract dan copy Nextcloud ke /var/www/html
1 2 | unzip nextcloud-14.0.4.zip cp -R nextcloud /var/www/html/ |
Buat folder data
1 | mkdir /var/www/html/nextcloud/data |
Beri hak akses dan owner folder nextcloud
1 2 | chown -R apache:apache /var/www/html/nextcloud/ chmod -R 755 /var/www/html/nextcloud/ |
Restart service httpd
1 | systemctl restart httpd |
Akses nama domain atau IP server yang dipakai pada konfigurasi virtual host Apache. Masukkan user admin nextcloud dan konfigurasi database.
Setelah instalasi selesai hasilnya seperti di bawah ini.
6. SSL (Opsional)
Selanjutnya kita bisa menambahkan SSL agar lebih aman.
Install yum-utils
1 2 | yum -y install yum-utils yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional |
Install certbot apache
1 | yum -y install python2-certbot-apache |
Lalu jalan certbot untuk generate SSL dengan membaca konfigurasi virtual host Apache
1 | certbot --apache |
Isian pertanyaan certbot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): alamat@email.com Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (A)gree/(C)ancel: A Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: namadomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1 Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 |
Akses kembali namadomain untuk menguji apakah sertifikat SSL sudah terpasang (HTTPS).
7. External Storage
Jika memiliki storage seperti Amazon S3, FTP/FTPS, SFTP, atau OpenStack Object Storage, kita dapat memasukkannya (attach/mount) ke Nextcloud. Caranya dengan mengaktifkan Apps Nextcloud dengan nama External Storages, kemudian pada menu Settings->Administration->External Storages konfigurasikan storage yang ingin dimount.
Panduannya bisa dibaca di doc.nextcloud.com.
Terima kasih kepada pak Nur Hamim dan Komunitas GNU/Linux Malang (KLiM) yang sudah berbagi ilmu.
selamat mencoba 🙂