Coder Social home page Coder Social logo

lemmy-ansible's Introduction

Lemmy-Ansible

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

Requirements

To run this ansible playbook, you need to:

  • Have a Debian/AlmaLinux 9-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).

Install

  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. Copy the sample vars.yml file

    cp examples/vars.yml inventory/host_vars/<your-domain>/vars.yml

    Edit the inventory/host_vars/<your-domain>/vars.yml file to your liking.

  7. 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:

    interpreter_python=/usr/bin/python3

Upgrading

  • 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.

Uninstall

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

License

Footnotes

  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. โ†ฉ

lemmy-ansible's People

Contributors

0xanansi avatar calbasi avatar codyro avatar cpressland avatar dessalines avatar dkruyt avatar dmtryptamines avatar eslerm avatar fadelkon avatar horsejump avatar jippi avatar maxpoulin64 avatar ncorder avatar nothing4you avatar novakeith avatar nutomic avatar pixlguru avatar redkrieg avatar rulasmur avatar sanatsathaye avatar tealk avatar tmpod avatar usr3 avatar zetaphor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.