Hosting FarmOS for Dummies

Hi, I want to install FarmOS on a webserver using cpanel. A few questions:

  1. Would I first need to install Drupal and then farmOS afterwards? I am not quite clued up with the backend of hosting.
  2. I can’t seem to find the “Hosting FarmOS for Dummies” (so to speak)… Could someone point me in the right direction where to find the easiest information about loading FarmOS onto a webserver?
  3. If I have a registered domain and hosting for example: mydomain.xx, could I install FarmOS on that domain? ( I will then make this domain private so that only I can access it)
1 Like

Hi @erdwurmboer - welcome to the farmOS community!

I haven’t hosted farmOS on a CPanel setup, so I can’t speak to it myself, but I think others have.

Would I first need to install Drupal and then farmOS afterwards?

No - farmOS includes Drupal with it, so you just need to download the packaged zip/tarball and unpack it in your server’s webroot.

It’s important to always use the packaged releases, because farmOS includes some patches to Drupal core and other contrib modules that won’t be there if you download the pieces separately.

where to find the easiest information about loading FarmOS onto a webserver?

The current “stable” version of farmOS is 7.x-1.7 (version 1.7 for Drupal 7). The 7.x-1.7 packaged release is available here: https://www.drupal.org/project/farm/releases/7.x-1.7 - and hosting/installation instructions are here: https://farmos.org/hosting/installing/

We are currently working on the new 2.x version of farmOS, however, and if you are just getting started you may want to try that instead, so you don’t have to worry about upgrading from 1.x->2.x in the future, which is a bit complicated.

The current version of farmOS 2.x is 2.0.0-alpha5 (we are very close to tagging the first “beta” release, but generally speaking it is stable and not much is going to change before then). The packaged release is available for download here: Release 2.0.0-alpha5 · farmOS/farmOS · GitHub - and the 2.x hosting/installation instructions are here: Installing farmOS | farmOS - that said, you will be an “early adopter” if you start with 2.x, so hopefully you’re up for reporting bugs etc. :wink:

There are currently two recommended approaches to hosting farmOS 2.x: 1) Docker and 2) Packaged releases. You will want to the “packaged release” approach, as I described above. Docs for that specifically are here: Installing farmOS | farmOS

And when it comes time to update to a new version (assuming you start with 2.0.0-alpha5), docs for updating packaged releases are here: Updating farmOS | farmOS

Make sure you read through all those docs thoroughly to understand the considerations and requirements. The Docker images pre-package all the server dependencies, but the packaged releases assume that your hosting server has everything, so your mileage may vary depending on your host.

If I have a registered domain and hosting for example: mydomain.xx, could I install FarmOS on that domain?

Sure! farmOS works just like a website (eg: Drupal, Wordpress, etc). You just need to put the code in your server’s webroot, and point your domain name at that.

I would also recommend setting up SSL certificates, if your host has support for that.

And of course… shameless plug: I provide “farmOS-as-a-service” hosting through Farmier.com, if you would rather have someone else take care of the hosting stuff.

Either way, good luck, welcome to the community, and feel free to ask questions! :slight_smile:

Thanks for the detailed Reply.Maybe I should have a trial run on farmier.com and see if it works for me? Could I later transfer my data from Farmier to my own server?

HI,

I’ve managed to unzip the farmOS 2.x is 2.0.0-alpha5 package into my domain root directory. When visit the url, i found a “Web” link, that took me to the install page. It asked me about my language. I selected English. It then want to configure the Database (which I created before hand). I entered the name and username and password associated with it. The clicked “save and continue”, but I only get a blank screen.When I refreshed after a while, I get a message farmOS 2.0.0-alpha5

Drupal already installed

  • To start over, you must empty your existing database and copy default.settings.php over settings.php .
  • To upgrade an existing installation, proceed to the [update script]
  • View your [existing site]

When I go to “existing site”, this message appears: The website encountered an unexpected error. Please try again later."

Is this a problem with the FarmOs2.x package? Or am I doing something wrong?

1 Like

I entered the name and username and password associated with it. The clicked “save and continue”, but I only get a blank screen.

Hmm - sounds like a PHP error occurred (sometimes results in a blank screen like this). Do you have access to your server’s Apache logs to see what the error was? That will help debugging.

FYI we host a weekly dev call if you want to try figuring this out together: farmOS Community Calls

We also have a chat room - feel free to post questions there and I (or others) can respond live (or when we’re available): https://app.element.io/#/room/#farmOS:matrix.org

1 Like

It was a small error on my side. The hosting company helped me fix it. And farmOS 2.x is 2.0.0-alpha5 is up and running! Wasn’t too difficult after all…

1 Like

Hi, I have started to install version 2 (new user). Install was going well (using the above instructions) until the end where I got the following error - I wonder if you can let me know how to resolve the issue ?

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /farmOS/web/core/install.php?rewrite=ok&profile=farm&langcode=en&id=2&op=do_nojs&op=do
StatusText: OK
ResponseText: ParseError: syntax error, unexpected ‘LogLocationInterface’ (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in Composer\Autoload\includeFile() (line 25 of /chroot/home/aea97723/868baac267.nxcli.net/html/farmOS/web/profiles/farm/modules/core/location/src/EventSubscriber/LogEventSubscriber.php).

Additional uncaught exception thrown while handling exception.
Original
ParseError: syntax error, unexpected ‘LogLocationInterface’ (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in Composer\Autoload\includeFile() (line 25 of /chroot/home/aea97723/868baac267.nxcli.net/html/farmOS/web/profiles/farm/modules/core/location/src/EventSubscriber/LogEventSubscriber.php).

Composer\Autoload\includeFile(’/chroot/home/aea97723/868baac267.nxcli.net/html/farmOS/web/profiles/farm/modules/core/location/src/EventSubscriber/LogEventSubscriber.php’) (Line: 428)
Composer\Autoload\ClassLoader->loadClass(‘Drupal\farm_location\EventSubscriber\LogEventSubscriber’)
spl_autoload_call(‘Drupal\farm_location\EventSubscriber\LogEventSubscriber’)
ReflectionClass->__construct(‘Drupal\farm_location\EventSubscriber\LogEventSubscriber’) (Line: 30)
Drupal\Core\DependencyInjection\Compiler\RegisterEventSubscribersPass->process(Object) (Line: 94)
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object) (Line: 762)
Symfony\Component\DependencyInjection\ContainerBuilder->compile() (Line: 1304)
Drupal\Core\DrupalKernel->compileContainer() (Line: 909)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 20)
Drupal\Core\Installer\InstallerKernel->initializeContainer() (Line: 473)
Drupal\Core\DrupalKernel->boot() (Line: 425)
install_begin_request(Object, Array) (Line: 115)
install_drupal(Object) (Line: 48)
Additional
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service “theme.manager”. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 1030 of /chroot/home/aea97723/868baac267.nxcli.net/html/farmOS/vendor/symfony/dependency-injection/ContainerBuilder.php).

Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition(‘theme.manager’) (Line: 600)
Symfony\Component\DependencyInjection\ContainerBuilder->doGet(‘theme.manager’, 1) (Line: 558)
Symfony\Component\DependencyInjection\ContainerBuilder->get(‘theme.manager’) (Line: 650)
Drupal::theme() (Line: 22)
_drupal_maintenance_theme() (Line: 471)
drupal_maintenance_theme() (Line: 1019)
install_display_output(Array, Array) (Line: 271)
_drupal_log_error(Array, 1) (Line: 330)
_drupal_exception_handler(Object)

Hi @oliverp44 - welcome to the forum!

Hmm I haven’t encountered these errors before myself. Can you tell me a bit more about your environment and the steps you followed specifically?

Are you using Docker (described here) or packaged release (described here)?

If you are using packaged release, what environment are you hosting in? Linux? What Apache/PHP version?

Or are you using the development environment setup instructions? (described here)

Any additional info you can provide would be helpful.

Thanks for coming back to me.
I am using Linux, php version 7.3 and trying the packaged release. I have tried it both with Drupal previously installed, then all files removed and also without having started with Drupal. When I set it up first with Drupal the Drupal site works fine (I then delete the html folder and its contents and create a new one). I am using a fresh / empty mysql database both time I have tried it…
I get all the information where it wants to gather information about db details and user etc but it fails when it starts to do the install.

I have tried it twice using the farmOS-2.0.0-alpha5.tar.gz file.

The main error which occurs when it fails is

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /farmOS/web/core/install.php?rewrite=ok&profile=farm&langcode=en&id=2&op=do_nojs&op=do
StatusText: OK
ResponseText: ParseError: syntax error, unexpected ‘LogLocationInterface’ (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in Composer\Autoload\includeFile() (line 25 of /chroot/home/aea97723/10b6712329.nxcli.net/html/farmOS/web/profiles/farm/modules/core/location/src/EventSubscriber/LogEventSubscriber.php).

1 Like

Ah I think farmOS requires PHP 7.4+ - we should update the web server requirements doc (here). Can you try updating your PHP version and see if that helps?

Would you like to update the docs and contribute that back as well? The relevant file to edit is here: https://github.com/farmOS/farmOS/blob/2.x/docs/hosting/install.md

More details: farmOS code makes use of “typed properties”, which were introduced in PHP 7.4.

https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.typed-properties

For what it’s worth, PHP 7.x is no longer supported (7.4 will receive security updates until November 2022, but no new feature development). We have an issue open for farmOS to start using PHP 8. So if at all possible you may want to just make the jump to PHP 8 right now.

Or use the farmOS Docker image, which will always have a compatible PHP version included.

Mike,

Thank you – that has solved the problem and it seems to have installed correctly.

I will take a look at the docs etc in due course however my main site does not like 7.4 so need to resolve that first !!

Out of interest is there the ability to print areas (ie agricultural fields) in this version. I found with my last system I could do that which was useful for showing a ploughman etc exactly where they were going and what to do ?

As I am only just getting going I will need to play with this version but it looks fantastic.

Thank you

Oliver

2 Likes

Excellent! Glad to hear that fixed it @oliverp44. :slight_smile:

is there the ability to print areas (ie agricultural fields) in this version

I haven’t tried it myself, but you may be able to just print a page with a map on it directly. I’d be curious how well that works in the new version. Give it a try and let us know!

For advanced map printing use-cases, farmOS_wfs (Please excuse the shameless plug - as I am the author of the farmOS_wfs contrib module) could be used to allow QGIS (or similar GIS software) to connect to farmOS. QGIS could then be used to create professional quality printable maps containing your farmOS assets via its Print Layout functionality.

5 Likes

Thank you - will take a look at the wfs module once the rest us up and running

1 Like

Mike

I am now getting up and running but couple of issues.

None of my locations show up in the dashboard map, even when they are selected in the layers to view panel. I have tried selecting / de selecting them, adding different location assets, and viewing in safari and edge.

Also I can’t see where I can activate google maps from. In the settings I have set up mapbox and entered its api and that works fine. But no sign of where I can enter google info.

1 Like

Hi @oliverp44

None of my locations show up in the dashboard map

Do they show up in /assets? Do they appear in the list in /locations? Are they “archived” perhaps? Is the “Location” checkbox checked when you edit them? These are all the things I would check first…

I can’t see where I can activate google maps from

Google Maps layers are not included with farmOS core anymore because they are somewhat buggy (Google’s fault, not ours). Instead we split them out to a “contrib” module that you have the option to download and install if you want to use them anyway: https://www.drupal.org/project/farm_map_google

Thanks Mike,

Yes the locations all show up in assets, and they also show the polygons / lines etc as you would expect. It is only when you look at one of the summary pages where you should see any of the layers selected that they do not show at all. I have tried with different areas such as water as well but they still don’t show. Screen shot below shows the layers are selected and assets below which should show. These areas I imported as KLM file but I did create one new prior to the import and it does not show either.

1 Like

Can you check these as well…

The dashboard map specifically shows geometries of Land, Water, and Structure assets… but only ones that are “active” (not archived) and designated as “Locations” (with the “Is location” checkbox checked on them).

Just deleted all the location assets (they were imported so easy to replace) to see if that was the issue but still no change. The locations are all active and shown as locations.

1 Like