I am trying to install Nextcloud on Debian 10.4.
I am using this HowTo:
My first problem was that:
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
Didn’t work. So i removed “sudo” to solve that problem. Since i already used the sudo command in the beginning i figured that was probably the problem.
Now my problem is that:
Service nginx restart is not working.
Error: service: command not found
Could someone tell me how to fix this?
And question two: why isn’t this HowTo 100% working
I used this multiple times 100% error free. I would not install nginx from another source if not nessasary. Why nginx and not apache2?
Why Nginx? Well to be honest, because this HowTo uses it. This HowTo also includes Fail2Ban and apticorn. Please a way to move storage.
But since that is not a really good reason i could switch to the HowTo you mentioned. I will first give this one a couple more tries, if i really cannot get through this one i will switch.
Edit: i always thought that Nginx was the better choice performance wise.
@devnull dev
I have solved the problem, solution was to use this command: systemctl restart nginx
But got a new one now.
sed -i “s/09,39.*/# &/” /etc/cron.d/php
(crontab -l ; echo “09,39 * * * * /usr/lib/php/sessionclean 2>&1”) | crontab -u root -
gives “no crontab for root”. Someone know how to solve this?
as root: crontab -e
and insert the line manually.
or use one of the many scripts:
Nextcloud Installationsskript auf Ubuntu 20.04 focal und Debian 11 bullseye mit nginx, MariaDB, PHP8, Let’s Encrypt, redis, ufw, fail2ban
nextcloud-reloaded
Ansible playbook to install nextcloud, php, nginx or apache, mariadb or postgres, redis-server, onlyoffice or collabora office
All of the problems you’re having seem unrelated to Nextcloud itself. These are really more general Linux questions.
I wrote a guide for a Docker based setup on Ubuntu. It would probably work similarly on Debian. You can use it for a reference too if you need any extra examples.
1.Overview
This is a general guide to setting up a functional Nextcloud instance using Ubuntu Server 18.04.3, Docker CE, Docker-Compose, Collabora CODE, and an Apache reverse proxy. By the end (and as of writing), this setup will have an A+ rating on Nextcloud Security Scan and Qualys SSL Server Test and a valid, self-updating certificate from Let’s Encrypt. I will also cover how to update everything.
I will do my best to plainly emphasize things that you will need to change, but it will mainly…
@Reiner_Nippes ,
I have a few questions about your script:
https://github.com/ReinerNippes/nextcloud
It is about the inventory file:
selfsigned certificate as default
ssl_certificate_type = ‘selfsigned’
Letsencrypt or selfsigned certificate
ssl_certificate_type = ‘letsencrypt’
If i would like to use letsencrypt, do i remove the first two lines or do i change ‘selfsigned’ to letsencrypt?
Looking at this part:
database settings
nc_db_type = ‘mysql’ # (MariaDB)
nc_db_host = ‘localhost’
nc_db_type = ‘pgsql’ # (PostgreSQL)
nc_db_host = ‘’
I have to remove the first 2 or the last 2 lines right? This is were you choose between MariaDB and PostgreSQL right?
This line:
php Version
php_version = ‘7.3’
Can i simply change this to 7.4 to use a newer version of PHP?
Install restic backup tool if backup_folder is not empty
to use a local directory as a restic repository (not a good idea anyway)
restic_repo = ‘/var/backups/nextcloud’
use rclone to backup a cloud storage, see https://rclone.org for more details
configure also rclone_remote in group_vars/all.yml
restic_repo = “rclone:backup-selfhosted:selfhosted-{{ lookup(‘password’, ‘{{ credential_store }}/restic_backup_s3_bucket_uid chars=ascii_lowercase,digits length=12’) }}/backup”
crontab setings for the backup script - default daily at 3pm
restic_backup_day = ‘*’
restic_backup_minute = ‘0’
restic_backup_hour: = ‘3’
If i don’t want to use restic and rsync i can remove the lines above right?
i think you got an old inventory version. assuming you use ubuntu/centos you can use the nextcloud-reloaded branch where things look a bit different.
# Selfsigned Certificate are Default
# nextcloud_certificate_type = 'selfsigned'
# Letsencrypt Certificate provided with acme.sh (https://github.com/Neilpang/acme.sh)
nextcloud_certificate_type = 'acme.sh'
each variable should appear only once. or ansible will give a warning. and take the last definition of the variable.
#nextcloud_db_type = 'mysql' # (MariaDB)
nextcloud_db_type = 'pgsql' # (PostgreSQL)
nextcloud_db_host = 'localhost'
nextcloud_db = 'nextcloud'
nextcloud_db_user = 'nextcloud'
nextcloud_db_passwd = ''
nextcloud_db_prefix = 'oc_'
this would install pgsql as database program. change it to
nextcloud_db_type = 'mysql' # (MariaDB)
#nextcloud_db_type = 'pgsql' # (PostgreSQL)
nextcloud_db_host = 'localhost'
nextcloud_db = 'nextcloud'
nextcloud_db_user = 'nextcloud'
nextcloud_db_passwd = ''
nextcloud_db_prefix = 'oc_'
would install mariadb.
yes. in the new branch this is done already.
no. you have to change it to restic_repo = ''
the playbook checks if the variable is not empty.
roles:
- { role: talk, when: install_talk|bool }
- name: 'install nextcloud'
hosts: nextcloud
become: true
gather_facts: false
roles:
- { role: restic_backup, when: restic_repo != '' }
- nextcloud
- fail2ban
post_tasks:
- name: check install status
uri:
url: https://{{ nextcloud_fqdn }}/status.php
return_content: yes
validate_certs: "{% if (nextcloud_certificate_type == 'selfsigned') or nextcloud_certificate_test %}no{% else %}yes{% endif %}"
register: nextcloud_status
but the playbook would fail if the variable isn’t defined.