# Installing entirely from CLI?

**URL:** <https://farmos.discourse.group/t/installing-entirely-from-cli/182>\
**Category:** Hosting farmOS\
**Created:** [January 9, 2020, 5:02pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182 "2020-01-09T17:02:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 9, 2020, 5:02pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/1 "2020-01-09T17:02:52Z")

</div>

Hello, I am pretty unfamiliar with linux, but I have been having a fun time with it.  
I believe I have everything set up, but I am now stuck on the fnal step of configuring the applicatrion with my web browser.  
I am using ubuntu server 18.04, but I did not install the GUI desktop.

Does anyone know if this is possible to do from the CLI or do I need to install desktop?  
Can I set the app to be finished from another computer on my network.

I apologize if this question is beyond the scope of this forum.  
Thanks!

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 9, 2020, 5:21pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/2 "2020-01-09T17:21:54Z")

</div>

Hi @scissors - I might need to understand the issue a bit better. Are you installing Apache/MySQL yourself and running farmOS in `/var/www/html` directly on your server? Or are you running Docker containers, perhaps?

It is possible to run farmOS on a server without any desktop (all command line). Once it is up and running farmOS is accessed entirely through a browser. After you have the code in place, the first time you load the farmOS page in your browser you should see a page that asks for database credentials, and then it walks you through the other steps in the database setup and site installation process.

farmOS is Drupal, so you can Google search for tutorials/guides/troubleshooting for Drupal hosting more generally as well. Drupal can be run in a lot of different environments/setups, so likewise farmOS can as well.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 9, 2020, 5:26pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/3 "2020-01-09T17:26:03Z")

</div>

> After you have the code in place, the first time you load the farmOS page in your browser you should see a page that asks for database credentials, and then it walks you through the other steps in the database setup and site installation process.

Oh… are you asking if it’s possible to do this via CLI?

Yes. Using Drush. [drush site install for drush 8.x](https://drushcommands.com/drush-8x/core/site-install/)

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 9, 2020, 5:39pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/4 "2020-01-09T17:39:31Z")

</div>

Yes, I am attempting to run Apache and MySQL, I think I am at the final step but I will need to wait until after work to try it out. I will look into Drush

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 12, 2020, 8:46am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/6 "2020-01-12T08:46:34Z")

</div>

Okay I got it all installed!  
Then I went about trying to fix all of the updates and managed to crash something in the openlayers thingy.

I see that @mstenta you have worked on this but I do not understand how you are fixing this in the comments here:

> **[Support PHP 7.2](https://www.drupal.org/project/openlayers/issues/2952602)**
>
> PHP 7.2 changes that affect openlayers include: fatal Cannot use 'Object' as class name as it is reserved

---

<div class="post-metadata">

**Author:** ![Lars](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@Lars](https://farmos.discourse.group/u/Lars)\
**Post date:** [January 12, 2020, 11:26pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/7 "2020-01-12T23:26:35Z")

</div>

I think there is a problem if you use the internal update features of drupal. As far as I know drupal updates that are shown in the admin area “inside” farmOS have to be applied as a complete update of either drupal or farmOS.

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 13, 2020, 4:06am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/8 "2020-01-13T04:06:38Z")

</div>

I had tried to upgrade openlayers by replacing the files in the modules folder manually, but I guess there was dependencies outside of that folder being referenced. I just reverted the files in the openlayers module folder with the ones from my back up and it works. The updates report still recommends me to update it but I will ignore it until I can figure out what went wrong. I was able to get the drupal core updated to 7.69 though!

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 13, 2020, 4:55am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/9 "2020-01-13T04:55:15Z")

</div>

Why does “myFarmName/farm/areas” give me a 404 but “myFarmName/?=farm/areas” work?

---

<div class="post-metadata">

**Author:** ![Lars](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@Lars](https://farmos.discourse.group/u/Lars)\
**Post date:** [January 13, 2020, 8:12pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/10 "2020-01-13T20:12:21Z")

</div>

There are a lot of dependencies. I had a similar problem in the past and ended up with a complete reinstall to fix everything.

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 14, 2020, 3:03am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/11 "2020-01-14T03:03:40Z")

</div>

I think I have the most recent version of farmOS and the most recent drupal core.  
Replacing the files in the open layers folder or doing the built in update script both result in errors of

| Unresolved dependency | elements (Missing) |
| --- | --- |
| Farm Area requires this module. | |

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 14, 2020, 9:18pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/12 "2020-01-14T21:18:16Z")

</div>

> Then I went about trying to fix all of the updates and managed to crash something in the openlayers thingy.

@scissors Take a look at the “Updating farmOS” user guide: [Updating farmOS | farmOS](https://farmos.org/hosting/updating/)

Specifically the big warning on top: 🙂

> Do not use Drupal’s automatic update feature  
> **This process may break your farmOS system.**

That’s exactly what happened in your case. Read through that page to understand why, and to understand the recommended process for upgrading.

farmOS 7.x-1.2 is a little behind in terms of updates, but the 7.x-1.x development branch has all of the latest, if you’d like to just use that: [https://www.drupal.org/project/farm/releases/7.x-1.x-dev](https://www.drupal.org/project/farm/releases/7.x-1.x-dev)

I generally recommend people use the tagged releases for stability, but the dev branch is usually stable too. For what it’s worth, the security warnings you see in 7.x-1.2 are not critical issues - they should not put your farmOS at risk, but they are annoying. I’ve been trying to wrap up some development before tagging 7.x-1.3 but keep getting sidetracked. Hopefully very soon!

> Why does “myFarmName/farm/areas” give me a 404 but “myFarmName/?=farm/areas” work?

This is because “Clean URLs” are not enabled on your site. I’m not sure if this is because your installation is broken, or if you will need to set this up manually regardless. I would probably suggest that you reinstall and see if it’s still an issue. And if it is, see this for more information: [https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls](https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls)

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 15, 2020, 3:22am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/13 "2020-01-15T03:22:58Z")

</div>

> Take a look at the “Updating farmOS” user guide

Thanks, did this, and it all seems to be working now.

> This is because “Clean URLs” are not enabled on your site.

The “Areas” section at the top was working but the Metrics link to the areas was broken.  
I had to enable the apache2 rewrite\_module to get this working, but so far so good.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 15, 2020, 1:46pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/14 "2020-01-15T13:46:21Z")

</div>

> Thanks, did this, and it all seems to be working now.

Great!!

> The “Areas” section at the top was working but the Metrics link to the areas was broken.

Ah ok! That would be a small bug with the Metrics link then: those should work without clean URLs too. I will fix that right now…

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 16, 2020, 4:58pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/15 "2020-01-16T16:58:10Z")

</div>

I am happy to say that my farm conspirators have successfully created accounts and are also finding the software useful. They are sort of internet nerdy people, but they had a pretty easy time figuring out how things work.

We have two questions though:

We would like some kind of local chat or forum we can use to commen outside of the logs. I played with the built in drupal forum for an hour or so but so far I am unimpressed. Is there any other slim messaging system that will play well with the farmOS install that you would recommend, or should I keep playing with the drupal forum?

Second, is there any recommended route for embedding images in our logs?

Thanks again!

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 16, 2020, 7:16pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/16 "2020-01-16T19:16:43Z")

</div>

> We would like some kind of local chat or forum we can use to commen outside of the logs.

In farmOS 2.0 we may be enabling comments on area, asset, and log records - which I think would do exactly what you describe. Nothing planned for farmOS 1.0 though, and I don’t have any good recommendations for that, unfortunately. Would a chat room help? We’ve been using Riot.im/Matrix.org for the farmOS chat and it works well for us.

> Second, is there any recommended route for embedding images in our logs?

You can attach images to logs, and they will be displayed automatically. But you can’t currently “embed” them directly into the “Notes” field, if that’s what you mean?

---

<div class="post-metadata">

**Author:** ![Symbioquine](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/symbioquine/32/284_2.png) [@Symbioquine](https://farmos.discourse.group/u/Symbioquine)\
**Post date:** [January 17, 2020, 3:16am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/17 "2020-01-17T03:16:59Z")

</div>

In case it is helpful to have a farmOS-specific example, these are the commands I use when creating test installations of farmOS;

```auto
alias drush="docker-compose exec www drush"
drush site-install farm --locale=us --db-url=mysql://farm:farm@db/farm --site-name=Test0 --account-name=root --account-pass=test install_configure_form.update_status_module='array(FALSE,FALSE)'

```

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [January 17, 2020, 4:28pm UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/18 "2020-01-17T16:28:37Z")

</div>

Thanks @Symbioquine - I use a similar bash `alias` in my `~/.bash_aliases` config file to make it easier to use `drush` within the Docker container. I like that you use `docker-compose exec` because then it isn’t tied to a specific Docker container (I run multiple farmOS containers on my laptop for testing etc).

---

<div class="post-metadata">

**Author:** ![scissors](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/scissors/32/68_2.png) [@scissors](https://farmos.discourse.group/u/scissors)\
**Post date:** [January 20, 2020, 3:45am UTC](https://farmos.discourse.group/t/installing-entirely-from-cli/182/19 "2020-01-20T03:45:13Z")

</div>

> We’ve been using Riot.im/Matrix.org for the farmOS chat and it works well for us.

This seems like awesome software, but slightly overkill. We wanted something simple and local that would potentially fit into farmOs in some way. I think I am going to see how friendly it works with phpBB.

> **[phpbb](https://www.drupal.org/project/phpbb)**
>
> This is a module that lets Drupal handle user- and session-management for phpBB, a popular forum / bulletin board system.
