# Install Nextcloud?



## stroudmw (Jan 3, 2020)

Hi, I was wondering if there was a definitive guide to installing Nextcloud on a Freebsd-12.1 Server? I've found several bits of information, but it generally seems outdated - and I can't get it to work! I get "not found" errors, and that kind of thing. So, I clearly have configuration issues.

I've tried nginx as well as apache24. I generally use mariadb. I'm thinking that mariadb and apache24 would be the simplest, but if it uses nginx that's good too!

So I've wiped my server, and plan on doing a fresh install of FreeBSD. But first... I need a step-by-step guide to Nextcloud that will actually work!  Something like this: https://websiteforstudents.com/inst...-04-with-apache2-mariadb-and-php-7-2-support/

Thanks


----------



## SirDice (Jan 3, 2020)

The howto section is not for asking how to do things. 

Posting in Howtos & FAQs

Thread moved.


----------



## SirDice (Jan 3, 2020)

I suggest you start by installing www/owncloud and reading the instructions that are printed after the install.


----------



## vermaden (Jan 3, 2020)

stroudmw said:


> Hi, I was wondering if there was a definitive guide to installing Nextcloud on a Freebsd-12.1 Server? I've found several bits of information, but it generally seems outdated - and I can't get it to work! I get "not found" errors, and that kind of thing. So, I clearly have configuration issues.
> 
> I've tried nginx as well as apache24. I generally use mariadb. I'm thinking that mariadb and apache24 would be the simplest, but if it uses nginx that's good too!
> 
> ...



I have installed Nextcloud 17.0.2 on FreeBSD 12.1 days ago, I will write an update to my older Nextcloud 13 on FreeBSD article:








						Nextcloud 13 on FreeBSD
					

Today I would like to share a setup of Nextcloud 13 running on a FreeBSD system. To make things more interesting it would be running inside a FreeBSD Jail. I will not describe the Nextcloud setup i…




					vermaden.wordpress.com


----------



## Jimny (Jan 3, 2020)

stroudmw said:


> Hi, I was wondering if there was a definitive guide to installing Nextcloud on a Freebsd-12.1 Server? I've found several bits of information, but it generally seems outdated - and I can't get it to work! I get "not found" errors, and that kind of thing. So, I clearly have configuration issues.
> 
> I've tried nginx as well as apache24. I generally use mariadb. I'm thinking that mariadb and apache24 would be the simplest, but if it uses nginx that's good too!
> 
> ...



Hi,

First, you need to install the FAMP stack. The following link will show you how to do it.
https://www.digitalocean.com/commun...ache-mysql-and-php-famp-stack-on-freebsd-12-0 

Then you could install nextcloud 17 with the following command.
`pkg install nextcloud-php73`

When the installation has been finished, enter the database server and create a database and user.

enter the database
`mysql -u root -p`

create a database for nextcloud
`create database nextcloud_db;`

create a user for nextcloud
`create user 'nextcloud_user'@'localhost' identified by 'yourpassword';`

grant the user all the privileges to the database
`grant all privileges on nextcloud_db.* to 'nextcloud_user'@'localhost';`

write the privileges
`flush privileges;`

Then open your browser and load the nextcloud webpage. You should see a configuration webpage, just enter the information when you create the database.

That's all. Good luck.


----------



## Lamia (Jan 4, 2020)

As long as you have a working FAMP (FreeBSD running Apache MySQL and PHP), you are good to go. Install Nextcloud via ports or PKG and configure it via its web interface.


----------



## stroudmw (Jan 4, 2020)

vermaden said:


> I have installed Nextcloud 17.0.2 on FreeBSD 12.1 days ago, I will write an update to my older Nextcloud 13 on FreeBSD article:
> 
> 
> 
> ...


Thanks! I would be really interested to read that when you're finished!


----------



## stroudmw (Jan 4, 2020)

Jimny said:


> Hi,
> 
> First, you need to install the FAMP stack. The following link will show you how to do it.
> https://www.digitalocean.com/commun...ache-mysql-and-php-famp-stack-on-freebsd-12-0
> ...


Thanks for that...
I've gone through the instructions as written. 
When I open firefox and type: http://<my_ip_address> I get apache24's "It Works!" message.
When I type in http://<my_ip_address>/nextcloud I get "Not Found".

So, I have Nextcloud installed... I just need to either configure it correctly, or to figure out how to access it on a web browser. Probably both... 


So I'm still doing something wrong.


----------



## vermaden (Jan 4, 2020)

stroudmw said:


> Hi, I was wondering if there was a definitive guide to installing Nextcloud on a Freebsd-12.1 Server? I've found several bits of information, but it generally seems outdated - and I can't get it to work! I get "not found" errors, and that kind of thing. So, I clearly have configuration issues.
> 
> I've tried nginx as well as apache24. I generally use mariadb. I'm thinking that mariadb and apache24 would be the simplest, but if it uses nginx that's good too!
> 
> ...



Here:
*Nextcloud 17 on FreeBSD 12.1*








						Nextcloud 17 on FreeBSD 12.1
					

Not so long ago – almost 2 years from now – I wrote about setting up Nextcloud 13 on FreeBSD. Today Nextcloud is at 17 version and the configuration that worked two years ago requires s…




					vermaden.wordpress.com


----------



## Lamia (Jan 5, 2020)

Have you seen this - https://forums.freebsd.org/threads/nextcloud-17-on-freebsd-12-1.73567/?


----------



## Jimny (Jan 5, 2020)

stroudmw said:


> Thanks for that...
> I've gone through the instructions as written.
> When I open firefox and type: http://<my_ip_address> I get apache24's "It Works!" message.
> When I type in http://<my_ip_address>/nextcloud I get "Not Found".
> ...



Hi, 

It seems the apache server do not get its proper configuration.

```
<Directory "/usr/local/www/apache24/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # [URL]http://httpd.apache.org/docs/2.4/mod/core.html#options[/URL]
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
```
You should change the directory to the directory where nextcloud  is installed, maybe '/usr/local/www/nextcloud'.


----------



## vermaden (Jan 5, 2020)

Lamia said:


> Have you seen this - https://forums.freebsd.org/threads/nextcloud-17-on-freebsd-12-1.73567/?


This is only part of my post - there is integration between my blog RSS and this forum, whatever I post it is automatically added here.

Works great for short *Valuable News* - does not work for too long posts like this one.


----------



## Lamia (Jan 5, 2020)

Jimny said:


> Hi,
> 
> It seems the apache server do not get its proper configuration.
> 
> ...


There are some apps that would "deny" access until being properly configured. It may be that you need to create a virtualhost to access them. Nextcloud could be one of them. I know that at some point you will be asked to enter the domain name for the app. There is no virtualhost conf. in what you posted.


----------



## stroudmw (Jan 11, 2020)

I still can't get it right. I've been through the tutorial using my testbed machine, but keep getting "page not found" when I try to access Nextcloud. I'm about to give up and stick with what I've got.


----------



## stroudmw (Jan 13, 2020)

OK. I think I've nailed down the problem to my domain... It looks like I might have to spend some money.


----------



## stroudmw (Jan 21, 2020)

I am really battling to get Nextcloud up and running on FreeBSD, and I really want to get this right.

I have a home server, currently running Nextcloud on Debian 10. It's connected to my Huawei wifi router, and you need to be in range of, and connected to my router to access Nextcloud. This means that my ISP doesn't get upset with high data usage.
It works great, but I love to tinker with things 

It connects 2 laptops, a desktop, 2 Android phones, and a tablet. Sometimes I give visiting family/friends access to my wifi so that they can download whatever might interest them. I store music, ebooks, documents, photos, etc on it.

What I want is a similar setup using FreeBSD. I don't need https/secure access (letsencrypt) as it is not public-facing, and I don't plan on using my own domain: I currently just enter my IP address in the web browser/android app to access Nextcloud/Debian. A jail is great, and I'm pretty sure that I can set that up.

So, I'd like Nextcloud running on top of Mariadb, Php73 and Apache24 in a Jail, but without the overhead/hassle of https. Nginx would also be fine, as would Postgres - it really doesn't matter to me.

As far as I can ascertain, my issues are: setting domain names ("localhost", the ip address, the server name, etc - I don't seem to know which one to use) consistently, and configuring Php and Apache. My "lightbulb" moment with Debian came when I stumbled across "a2ensite" - which not all of the how-to guides chose to mention.

Would someone please point me to a "how-to" guide? For a simple setup? Duckduckgo and I have been through the exercise a half dozen times over the last few weeks and can never get it right. I install the prerequisites, create my database, and... nothing.

So, I'm missing something, and my frustration level is rising 

Thank you.


----------



## stroudmw (Jan 22, 2020)

Having spent another 2 days on this,  I give up!


----------



## Remington (Jan 22, 2020)

Have you tried net-mgmt/seafile-server?  I like Seafile better than Nextcloud as it doesn't depend on PHP.  It allows me to sync folders across several computers as I travel very often and also access the files on the web.  It has encryption feature too.


----------



## vermaden (Jan 23, 2020)

stroudmw said:


> I am really battling to get Nextcloud up and running on FreeBSD, and I really want to get this right.
> 
> I have a home server, currently running Nextcloud on Debian 10. It's connected to my Huawei wifi router, and you need to be in range of, and connected to my router to access Nextcloud. This means that my ISP doesn't get upset with high data usage.
> It works great, but I love to tinker with things
> ...


Just use this guide:








						Nextcloud 17 on FreeBSD 12.1
					

Not so long ago – almost 2 years from now – I wrote about setting up Nextcloud 13 on FreeBSD. Today Nextcloud is at 17 version and the configuration that worked two years ago requires s…




					vermaden.wordpress.com


----------



## stroudmw (Jan 26, 2020)

Remington said:


> Have you tried net-mgmt/seafile-server?  I like Seafile better than Nextcloud as it doesn't depend on PHP.  It allows me to sync folders across several computers as I travel very often and also access the files on the web.  It has encryption feature too.


No, I haven't... thanks for the recommendation!


----------



## stroudmw (Jan 26, 2020)

vermaden said:


> Just use this guide:
> 
> 
> 
> ...


I have... 3 times. I'm going through it again. I suspect that I had my domains confused.


----------



## James (Jan 27, 2020)

If setting the domain is the problem have you tried:

sudo -u www php /usr/local/www/nextcloud/occ config:system:set trusted_domains 1 --value=yourlocalipaddress


----------



## stroudmw (Jan 30, 2020)

James said:


> If setting the domain is the problem have you tried:
> 
> sudo -u www php /usr/local/www/nextcloud/occ config:system:set trusted_domains 1 --value=yourlocalipaddress


I haven't... but I will, thanks. I have issues with letsencrypt as I'm using a parked domain. I don't want to pay someone to host it when I plan on doing it myself. And, as it's not a public-facing server, I really don't need "https".


----------



## SirDice (Jan 30, 2020)

The issue you mentioned in post #8 and #14 appears to be related to your Apache config.


----------



## stroudmw (Jan 31, 2020)

I've finally got it! But it needs some configuration... which scares me as whenever I try what is recommended I end up breaking it. So I might just make do with what I've got. I do need a firewall, though. Something like ufw. Any recommendations?

I followed this to set it up: https://levlaz.org/installing-nextcloud-on-a-freebsd-vps/

Thanks to all of you for your help and patience!


----------



## stroudmw (Feb 1, 2020)

I should point out (in reference to the article I referenced above) that I've installed PHP7.3, Mariadb55, and Nextcloud 18.


----------



## pastic (Mar 2, 2020)

stroudmw said:


> I should point out (in reference to the article I referenced above) that I've installed PHP7.3, Mariadb55, and Nextcloud 18.


Why did you install MariaDB 5.5? It goes EOL soon.
2020-04-11 Expected End-of-Life MariaDB 5.5
MariaDB 10.x has been around for ages...


----------



## SirDice (Mar 2, 2020)

Note that MariaDB 10.1 and 10.2 will be EoL some time soon too (probably in July).


----------



## Oriann (Mar 4, 2020)

stroudmw just use tutorials made for linux and change commands to respect freebsd hierarchy.

For example here: Linuxbabe how to install Nextcloud on Ubuntu 18.04 , make sure you install FEMP stack and you are good to go. Also install always the newer version of Mysql or Mariadb or PHP, you will have longer support until EOL.


----------



## stroudmw (Mar 9, 2020)

pastic said:


> Why did you install MariaDB 5.5? It goes EOL soon.
> 2020-04-11 Expected End-of-Life MariaDB 5.5
> MariaDB 10.x has been around for ages...


yeah... I meant 10


----------



## SKull (Mar 9, 2020)

stroudmw here's what you have to do:
1. pkg install whatever you need.
2. Follow the instructions on The official nextcloud documentation

There's literally nothing FreeBSD specific to keep an eye on.
However, there are several DB as well as PHP and php-fpm specific points you have to tune. They're all mentioned in the documentation I linked.

Source: I did just that two weeks ago.


----------



## stroudmw (Mar 10, 2020)

I've got it working pretty well. The upload speed (the speed uploads data to my FreeBSD Nextcloud server) isn't great. I was getting approx 50 MiB/s with Debian, and am getting about 1/10th of that now. Which meand that the estimated time is 10 hours instead of an hour or 2.

I've setup the various caches (redis, opcache) and Nextcloud doesn't report any configuration errors.
I suspect the issue is with my ancient Realtek RTL8111/8168/8411 PCI network card.


----------



## myzhugh (Aug 28, 2021)

Have you got it run?
I also want to do it.


----------

