386 views
# farmos blog post ## Farming in the Co-op Clouds _Guest post by Calix from Co-op Cloud / Autonomic Co-operative_ Let's say you want to join the public-interest agricultural software movement by setting up your own instance of FarmOS – maybe you're a farmer yourself, maybe you're in a community group or an NGO which is working with producers, or an agricultural technology coöperative – and you want support implementing some of the "production" aspects of self-hosting, like backups, versioning and security. Enter Co-op Cloud, which we designed to make it easier to run your own instances of ["free software"](httops://en.wikipedia.org/wiki/Free_software) apps like FarmOS. This quick write-up will go through how Co-op Cloud could help: making your first FarmOS deployment more manageable, making it easier to scale up to host multiple FarmOS instances per server or to spread hosting across multiple servers, or add other apps like file- and calendar-sharing, Single Sign On, or communication tools. We'll assume a little basic knowledge of the Linux command-line, and a tiny bit of DNS knowledge: if you've ever run a Linux server, you should be fine – you won't need to know details of the underlying technologies we're using (PHP/Drupal, Docker, databases, or anything else)! For this example, we'll deploy FarmOS on the `demo.coopcloud.tech` server, on the domain name `farmos.demo.coopcloud.tech`. We'll start with: - `abra` installed on your computer, following [the quick-start guide](https://docs.coopcloud.tech/operators/tutorial/#command-line-setup) - A Debian 11 virtual server, with Docker installed and configured for "swarm mode" ­(either using `abra server add --provision`, or [the manual instructions in the Co-op Cloud documentation](https://docs.coopcloud.tech/operators/tutorial/#server-setup)), configured for SSH access from your computer - A DNS record for your FarmOS site; in this case a `CNAME` for `farmos.demo.coopcloud.tech` pointing to our server `demo.coopcloud.tech` (you could alternatively use an `A` record, and if you're deploying to an "apex" domain like `myfarmos.site`, you have to!) - Traefik deployed to e.g. `traefik.demo.coopcloud.tech`, [following the quick-start guide](https://docs.coopcloud.tech/operators/tutorial/#command-line-setup) First, set up the remote connection to your server: run `abra server add demo.coopcloud.tech calix 2234` on your computer (replace `demo.coopcloud.tech` with the address of your server, `calix` with your username, and `2234` with your SSH port -- you can leave SSH port blank if you're on the default port 22). Then, we'll define a new instance by running `abra app new farmos`, then choose your server, type a domain name (or press enter/return to accept the default suggestion), and answer "y" when you're asked whether to "Generate app secrets" -- make a note of the database password for later. Now we're ready to run `abra app deploy farmos.demo.coopcloud.tech` (replace `farmos.demo.coopcloud.tech` with your FarmOS domain name) to deploy the instance to your server. Go to https://farmos.demo.coopcloud.tech and run through the installer. Your database settings will be: - "Type": Postgres - "Username": farm - "Password": (paste in the password from earlier) - "Database": farm - Click "Advanced", then for "Database host": `farmos_demo_coopcloud_tech_db` (replace dots with underscores in your domain name, and add `_db`) Once the installer has finished, you'll automatically land on the FarmOS dashboard! ## Next steps **Backups**: You can use `abra app backup farmos.demo.coopcloud.tech` (again, replace with your FarmOS domain name) to take an ad-hoc backup of your database and files, or set up Co-op Cloud's [`backup-bot-two`](https://git.coopcloud.tech/coop-cloud/backup-bot-two/) to configure automated backups. **Version upgrades**: When a new version of FarmOS is published, you can run `abra app upgrade farmos.demo.coopcloud.tech` to upgrade to the latest version. You can also use `abra app downgrade farmos.demo.coopcloud.tech` to return to an earlier version in case of problems (you'll probably want to restore a database backup from before the upgrade). **Other apps**: If you'd also like to run calendar & file-sharing, chat, social media, a website, a forum, you can use a similar process! Check out [the Co-op Cloud "recipe" catalogue](https://recipes.coopcloud.tech/), and `abra app new <something>` away! **Join the community**: For help with Co-op Cloud, or to make requests for extra features or for new apps, find us on Matrix [in the Co-op Cloud "space"](https://matrix.to/#/#coop-cloud-space:autonomic.zone) (or via the "Co-op Cloud General" room, if your Matrix client doesn't support Spaces), or email us on [helo@coopcloud.tech](helo@coopcloud.tech) if you'd like to get in touch through other means.