# Docker-compose example for RPI 4

**URL:** <https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317>\
**Category:** Hosting farmOS\
**Created:** [August 17, 2022, 3:50pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317 "2022-08-17T15:50:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjackson05](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@hjackson05](https://farmos.discourse.group/u/hjackson05)\
**Post date:** [August 17, 2022, 3:50pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/1 "2022-08-17T15:50:17Z")

</div>

Hi,  
I’m farmOS noob and trying to run farmOS on RPI4 using docker and docker-compose.

I’ve tried with farmos docker image versions ‘latest’ and ‘2.x’ but I’ve got below error:

> exec /usr/local/bin/docker-entrypoint.sh: exec format error

my noob points are:

- is possible run farmOS on arm64?
- is there a docker command example to run on RPI4?

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [August 17, 2022, 4:39pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/2 "2022-08-17T16:39:04Z")

</div>

Yes it is, but there are currently no docker images available for arm64 so you need to build them yourself.

Here is my process.

> **[farmOS Version 2 Raspberry Pi Install.](https://farmer-eds-shed.com/farmos-version-2-raspberry-pi-install/)**
>
> Recently I started using farmOS as my farm management software, a major new version has just been released which requires a fresh install and migration. The following is the process I used to setup…

It may not be 100% complete and could probably do with a few bits updated but should get you going.  
Any gaps I’m sure can be filled in here.

---

<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:** [August 17, 2022, 6:09pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/3 "2022-08-17T18:09:02Z")

</div>

And for reference, here is a link to the issue we have that will enable building arm64 images of farmOS: [Use GitHub Actions to build Docker Hub images [#3203129] | Drupal.org](https://www.drupal.org/project/farm/issues/3203129)

---

<div class="post-metadata">

**Author:** ![hjackson05](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@hjackson05](https://farmos.discourse.group/u/hjackson05)\
**Post date:** [August 17, 2022, 11:53pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/4 "2022-08-17T23:53:30Z")

</div>

Thaks a lot @Farmer-Ed, with the step-by-step I could install farmOS, but after wait almost a hour I got the error below in browser.

> # Forbidden
> 
> You don’t have permission to access this resource.

I’ve tried:

- delete www folder and containers and after reinstall
- grant chmod 777 to www folder recursively
- at least run containers without bind volumes

farmOS container logs

> Attempting: apache2-foreground  
> [Wed Aug 17 23:41:23.204390 2022] [mpm\_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) configured – resuming normal operations  
> [Wed Aug 17 23:41:23.204678 2022] [core:notice] [pid 1] AH00094: Command line: ‘apache2 -D FOREGROUND’  
> [17/Aug/2022:23:50:17 +0000] “GET /test HTTP/1.1” 404 495 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36”
> 
> [17/Aug/2022:23:51:08 +0000] “-” 408 0 “-” “-”  
> [Wed Aug 17 23:53:03.684663 2022] [autoindex:error] [pid 22] [client AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive  
> [17/Aug/2022:23:53:03 +0000] “GET / HTTP/1.1” 403 498 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36”  
> [17/Aug/2022:23:53:55 +0000] “-” 408 0 “-” “-”

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [August 18, 2022, 12:14pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/5 "2022-08-18T12:14:27Z")

</div>

How far did you get in the install? Just the docker image built or got through the Drupal install steps?

what dose your docker-compose.yml look like?

---

<div class="post-metadata">

**Author:** ![hjackson05](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@hjackson05](https://farmos.discourse.group/u/hjackson05)\
**Post date:** [August 18, 2022, 3:36pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/6 "2022-08-18T15:36:27Z")

</div>

Hi @Farmer-Ed,  
I followed the step-by-step:

- docker instalation
- docker compose  
after
- git instalation
- git clone…
- folder creation farmOS/docker
- farmos build  
after
- farmos folder creation under my user folder
- copy and past the docker\_compose example

but after docker\_copose up -d commnad, I got the mentioned error.

the only modification that I did on docker-compose was the host port number from 80 to 8000. as ‘8000:80’

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [August 18, 2022, 6:47pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/7 "2022-08-18T18:47:44Z")

</div>

Ah crap…  
Try this one, I pushed an image to Docker Hub as well so should get you going  
you can change ports and passwords as you need

```auto
version: '3'
services:
  db:
    image: postgres:12
    volumes:
      - './db:/var/lib/postgresql/data'
    ports:
      - '5432:5432'
    environment:
      POSTGRES_USER: farm
      POSTGRES_PASSWORD: farm
      POSTGRES_DB: farm

  www:
    depends_on:
      - db
    image: farmered/farmos:2.0.0-beta6
    volumes:
      - './www:/opt/drupal/sites'
    ports:
      - '80:80'

```

@mstena hope you don’t mind if I push some ARM64 images to Docker hub  
[https://hub.docker.com/repository/docker/farmered/farmos](https://hub.docker.com/repository/docker/farmered/farmos)

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [September 29, 2022, 4:29pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/8 "2022-09-29T16:29:48Z")

</div>

Latest Beta7 Release built for ARM64 [Docker Hub](https://hub.docker.com/repository/docker/farmered/farmos)

---

<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:** [November 20, 2022, 9:05pm UTC](https://farmos.discourse.group/t/docker-compose-example-for-rpi-4/1317/9 "2022-11-20T21:05:54Z")

</div>

Update: we are now using GitHub Actions to build and publish our Docker images to Docker Hub! 🎉

This was one of the prerequisites for building/pushing official farmOS Docker images for ARM64 / Raspberry Pi.

If anyone is interested in helping with that next step, here is the official tracking issue: [Build official ARM64 Docker images [#3322762] | Drupal.org](https://www.drupal.org/project/farm/issues/3322762)
