Install Lemmy Self-Hosted Reddit Alternative on Linux

preview_player
Показать описание
#Lemmy #Self-Hosted #Linux

What is Lemmy?
 
   01. Log into the Linux device
   02. Run the following commands in a terminal window
         # update software repositories
         sudo apt update
         # install available software updates
         sudo apt upgrade -y
         # install prerequisites
         sudo apt install git build-essential gcc libssl-dev pkg-config libpq-dev curl gnupg2 espeak postgresql -y
         # enable the postgresql service and start it
         sudo systemctl enable postgresql --now
         # connect to postgresql
         sudo -u postgres psql postgres
         # create lemmy database user
         create user lemmy with password 'L3mmy' superuser;
         # create lemmy database
         create database lemmy with owner lemmy;
         # close postgresql connection
         exit
         # add nodejs software repository
         # install nodejs
         sudo apt install nodejs -y
         # install yarn
         sudo npm install -g yarn
         # create lemmy user
         sudo useradd -m -d /opt/lemmy lemmy
         # install rust, enter 1 at the prompt
         # configure the shell
         source $HOME/.cargo/env
         # clone the lemmy git repository
         # change directory to the source code
         cd server
         # build lemmy
         cargo build --release
         # change directory out of lemmy server
         cd ..
         # move lemmy to /opt/lemmy
         sudo mv ./server /opt/lemmy/
         # switch user to lemmy
         sudo su lemmy
         # change directory to lemmy home
         cd ~
         # print working directory, should output /opt/lemmy
         pwd
         # clone lemmy frontend
         # change directory to lemmy-ui
         cd lemmy-ui
         # clean npm cache
         npm cache clean --force
         # install npm dependencies
         npm install
         # fix npm vulnerabilities
         npm audit fix
         # build lemmy-ui
         yarn build:prod
         # exit lemmy shell
         exit
         # create lemmy service file
         [Unit]
         Description=Lemmy
         [Service]
         User=lemmy
         Group=lemmy
         ExecStart=/opt/lemmy/server/target/release/lemmy_server
         WorkingDirectory=/opt/lemmy/server
         [Install]
   04. Press CTRL+O, Enter, CTRL+X to write the changes
   05. Continue with the following commands
         # create lemmy-ui service bash file
         #!/usr/bin/bash
   07. Continue with the following commands
         # create lemmy service file
         [Unit]
         Description=Lemmy-UI
         [Service]
         Restart=always
         User=lemmy
         Group=lemmy
         Environment=PATH=/usr/bin:/usr/local/bin
         Environment=NODE_ENV=production
         WorkingDirectory=/opt/lemmy/lemmy-ui
         [Install]
   09. Press CTRL+O, Enter, CTRL+X to write the changes
   10. Continue with the following commands
         # reload systemd services
         sudo systemctl daemon-reload
         # start lemmy service on boot and now
         sudo systemctl enable lemmy --now
         # start lemmy-ui service on boot and now
         sudo systemctl enable lemmy-ui --now
   12. Enter a username, email and password to create a site administrator account ≫ Click Sign Up
   13. Enter a site name and any additional optional values ≫ Click Create
   14. Welcome to Lemmy
 
 

### Connect with me and others ###
Рекомендации по теме
Комментарии
Автор

you dont install the pict-rs service what up with that ?

duckie
Автор

can this be installed on shared hosting?

BigDome
Автор

How to do it on your domain instead of localhost?

AryanChaurasia