lemmy ansible scripts configured for Rocky Linux ARM
Go to file
2023-06-27 07:04:08 +00:00
examples updated customPostgresql.conf to match pi hardware 2023-06-27 07:04:08 +00:00
files Use /etc to configure docker logging (#52) 2022-08-29 15:38:14 -04:00
templates Allow lemmy-ui and pictrs to access external network. Fixes #96 (#97) 2023-06-23 12:56:01 -04:00
.gitignore Move password into domain folder. 2021-10-09 12:13:23 -04:00
.woodpecker.yml Add prettier to ci (#80) 2023-06-07 22:45:24 +02:00
ansible.cfg Adding a note about priviledges to README. (#18) 2021-11-26 12:36:37 +00:00
lemmy.yml finnished lemmy.yml rewrite 2023-06-27 06:51:00 +00:00
LICENSE Adding AGPL license. Fixes #37 (#39) 2022-05-09 22:45:52 +00:00
README.md Add Ubuntu dependency to README (#92) 2023-06-22 18:39:52 -04:00
uninstall.yml Add prettier to ci (#80) 2023-06-07 22:45:24 +02:00
VERSION Updating VERSION 2023-06-23 08:36:10 -04:00


This provides an easy way to install Lemmy on any server. It automatically sets up an nginx server, letsencrypt certificates, and email.


To run this ansible playbook, you need to:

  • Have a Debian-based server / VPS where lemmy will run.
  • Configure a DNS A Record to point at your server's IP address.
  • Make sure you can ssh to it, with a sudo user: ssh <your-user>@<your-domain>
  • Install Ansible on your local machine (do not install it on your destination server).


  1. Clone this repo:

    git clone https://github.com/LemmyNet/lemmy-ansible.git
    cd lemmy-ansible
  2. Make a directory to hold your config:

    mkdir -p inventory/host_vars/<your-domain>

  3. Copy the sample configuration file:

    cp examples/config.hjson inventory/host_vars/<your-domain>/config.hjson

    Edit that file and change the config to your liking. Note: Do not edit anything inside the {{ }} braces.

    Here are all the config options.

  4. Copy the sample inventory hosts file:

    cp examples/hosts inventory/hosts

    Edit the inventory hosts file (inventory/hosts) to your liking.

  5. Copy the sample postgresql.conf

    cp examples/customPostgresql.conf inventory/host_vars/<your-domain>/customPostgresql.conf

    You can use the PGTune tool to tune your postgres to meet your server memory and CPU.

  6. Run the playbook:

    ansible-playbook -i inventory/hosts lemmy.yml

    Note: if you are not the root user or don't have password-less sudo, use this command:

    ansible-playbook -i inventory/hosts lemmy.yml --become --ask-become-pass

    Note: if you haven't set up ssh keys1, and ssh using a password, use the command:

    ansible-playbook -i inventory/hosts lemmy.yml --become --ask-pass --ask-become-pass

    Full ansible command-line docs

    If the command above fails, you may need to comment out this line In the ansible.cfg file:



  • Run git pull
  • Check out the Lemmy Releases Changelog to see if there are any config changes with the releases since your last.
  • Run ansible-playbook -i inventory/hosts lemmy.yml --become

Migrating your existing install to use this deploy

  • Follow this guide to backup your existing install.
  • Run docker-compose stop to stop lemmy.
  • Move your docker folders on the server to <lemmy_base_dir>/<your-domain>.
  • Copy your postgres password to inventory/host_vars/<your-domain>/passwords/postgres.
  • Follow the install guide above, making sure your config.hjson is the same as your backup.


ansible-playbook -i inventory/hosts uninstall.yml --become


  1. To create an ssh key pair with your host environment, you can follow the instructions here, and then copy the key to your host server. ↩︎