Building and running OpenCloud on FreeBSD with Apache as reverse proxy #2058
Replies: 6 comments
-
|
thanks for sharing 👍 |
Beta Was this translation helpful? Give feedback.
-
|
Hello everyone, building under FreeBSD 15.0 RELEASE works wonderfully. does anyone have an idea how I could solve this? |
Beta Was this translation helpful? Give feedback.
-
|
@aduffeck Maybe the check also needs to be adapted to FreeBSD? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Klex167, may I ask, on what type of filesystem your root‘s home directory (OpenCloud data directory) is located? Is it FreeBSD UFS or is it ZFS? I am running OpenCloud on UFS without any problems regarding extended attributes. But if I try to sync data on to a ZFS filesystem, it gives me errors on those extended attributes starting with „user.“. In your case it has a problem with „user.posixfs.test“. See opencloud-eu/reva#455. Seems, ZFS doesn‘t like that „user“ prefix. I am curious, if this problem would also arise on a Linux with ZFS filesystem… Best regards |
Beta Was this translation helpful? Give feedback.
-
|
Many thanks for sharing this. Off course FreeBSD should be documented and supported by default. |
Beta Was this translation helpful? Give feedback.
-
|
It would be really nice to have this in the FreeBSD ports. Has anyone started working on that? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I would like to share my experiences with building and running OpenCloud on FreeBSD. I am running home servers on FreeBSD 14.3 and wanted to give OpenCloud a try in comparison to Nextcloud. But I wanted to run OpenCloud natively on FreeBSD, not inside a Docker
container. FreeBSD itself already ships with virtualization technologies like jails and bhyve.
A very good starting point is the Bare-Metal installation guide on the homepage.
Building OpenCloud
To build OpenCloud I set up a dedicated virtual machine as a build server running FreeBSD 14.3. You can follow the installation guide and install required packages using
pkg install:gitgo(must be version 1.24 or higher)npmbashgmakeAlso, install and enable
corepackas described.The build itself does not require you to be the root user.
Now, clone the repository, change into the directory and start the build:
Biggest difference here is to use the
gmakecommand instead ofmake. At this point the build might report an error. To get more information you can add the-dparameter to thegmakecommand. It is likely, that the error points to a problem in the GoUtil component of Gookit. Here, sysutil is not able to determine the correct operating system. Fortunately, somebody already added FreeBSD support to GoUtil, so we can download a single file to patch the local build environment:After that, start the build again. This time it should run successfully and you end up with a single binary in the
opencloud/bindirectory. Move the binary to the desired target directory (in FreeBSD this is usually/usr/local/bin).Running OpenCloud
Once again, follow the Bare-Metal installation guide to initialize and run OpenCloud. As OpenCloud is built with Docker in mind, please note, that almost all configuration is done using environment variables. So you have to set some variables prior to running OpenCloud, the most important ones being
OC_URL,OC_CONFIG_DIR,OC_BASE_DATA_PATHandOC_INSECURE. You can also get rid of the Go memory limit warning by settingAUTOMEMLIMIT_EXPERIMENT=system. In this example, the URL would be https://opencloud.domain.tld.To start OpenCloud as a service, you can create an rc script in the
/usr/local/etc/rc.ddirectory. I took the rc script from another piece of Go software as blueprint and created a script namedopencloudwith the following content:I also opted to outsource all required environment variables to an environment file named
opencloud.env. This stops pollution of the rc script. I put this file into the/usr/local/etcdirectory. You also have to add the following lines to/etc/rc.conf:Configure OpenCloud to run behind Apache
Apache httpd can be used as proxy to forward requests to OpenCloud. To accomplish this, you need a dedicated subdomain for OpenCloud (here opencloud.domain.tld) and a certificate for secure connections. The key and certificate files must be placed inside the
OC_BASE_DATA_PATH/proxydirectory. For simplicity name themserver.crtandserver.key. In Apache, a virtual host must be defined that acts as a reverse proxy. Create a file inside the/usr/local/etc/apache24/extradirectory, this will automatically be picked up:I hope I covered all steps and did not forget anything important.
It would be great, if FreeBSD would be supported natively one day.
A great thank you to the team behind OpenCloud!
Best regards
Beta Was this translation helpful? Give feedback.
All reactions