diff options
| author | BiasedRiot <> | 2021-07-01 14:01:41 +0000 |
|---|---|---|
| committer | BiasedRiot <> | 2021-07-01 14:01:41 +0000 |
| commit | 720b80b72dc22390b44ebb4a1ecf15a6ad66644b (patch) | |
| tree | 27fb5ebcf12a35f84e31b22a3262ce52d0631070 /pleroma.html | |
| parent | ca91560ace2a722516b1ccfefe6a673e41e88871 (diff) | |
Adding pleroma guide
Diffstat (limited to 'pleroma.html')
| -rw-r--r-- | pleroma.html | 190 |
1 files changed, 190 insertions, 0 deletions
diff --git a/pleroma.html b/pleroma.html new file mode 100644 index 0000000..6b67907 --- /dev/null +++ b/pleroma.html @@ -0,0 +1,190 @@ +<!DOCTYPE html> +<html lang=en> + <head> + <title>Setup a Pleroma Server – LandChad.net</title> + <meta charset="utf-8"/> + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> + <link rel='stylesheet' type='text/css' href='style.css'> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'> + </head> +<body> + <header><h1>Setup a Pleroma Server</h1></header> + <nav></nav> + <main> + + <p>Hopefully by now you won't have to be sold on the invasive practices that social media companies conduct. Websites such as Facebook and Twitter aquire so much data on users that they often know more about you than you know about yourself. + +The simple solution to this is to not use social media. However, that just isn't an option for most people. So the next best thing is to setup a self-hosted and federalised social media site so that you have full control over your data. + +I've previously made<a href="https://www.youtube.com/watch?v=l7mVsLSsotU"> a video showing all the steps in depth if you want to check it out.</a> If you run into any issues I suggest you look at the video. +</p> + + <p>You'll need a server or VPS. Nearly any Operating system is supported but for this tutorial I'm gonna presume you're using a Debian-based OS. You'll also need a domain name pointing to your server's IP address <a href="https://landchad.net/dns.html">which is explained in this tutorial.</a> + </p> + + + +<h2>Installation</h2> + +<h3>Setting Up and Configuring</h3> + +<p>First things first you'll need to make sure that you've hardened you SSH so that password authentication is disabled and you'll also want to setup Fail2Ban. +There's a great tutorial on how to do this <a href="https://landchad.net/sshkeys.html">which can be read here.</a> +</p> + +<p> +Next we'll need to determine which OS flavour you're using. You'll need this for later simply run the below command: +</p> + +<pre><code>arch="$(uname -m)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;fi;echo "$arch$libc_postfix"</code></pre> + +<p> +Next we'll install the required packages. Run the below comman: +</p> + +<pre><code>sudo apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot libmagic-dev +</code></pre> + +<p> +You can manually configure postgreSQL to suit your system better. <a href="https://docs-develop.pleroma.social/backend/configuration/postgresql/">Check out the documentation here</a> and then run the below command: +</p> + +<pre><code>sudo systemctl restart postgresql +</code></pre> + + +<h3>Installing the Pleroma App</h3> + +<p> +First create the Pleroma user by running the below command: +</p> + +<pre><code>adduser --system --shell /bin/false --home /opt/pleroma pleroma +</code></pre> + +<p> +Next you'll need to set the FLAVOUR variable to whatever your OS flavour was from the first step using this command: +</p> + +<pre><code>export FLAVOUR="amd64-musl" +</code></pre> + +<p> +Using the Pleroma user previously created clone the Pleroma app: +</p> + +<pre><code>su pleroma -s $SHELL -lc " +curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=$FLAVOUR' -o /tmp/pleroma.zip +unzip /tmp/pleroma.zip -d /tmp/ +" +</code></pre> + +<p> +Then run the next list of commands to move the files the the right locations, set the permissions etc... : +</p> + +<pre><code>su pleroma -s $SHELL -lc " +mv /tmp/release/* /opt/pleroma +rmdir /tmp/release +rm /tmp/pleroma.zip +" + +mkdir -p /var/lib/pleroma/uploads +chown -R pleroma /var/lib/pleroma +mkdir -p /var/lib/pleroma/static +chown -R pleroma /var/lib/pleroma +mkdir -p /etc/pleroma +chown -R pleroma /etc/pleroma + +su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql" + +su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" + +su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" + + +su pleroma -s $SHELL -lc "./bin/pleroma daemon" + +sleep 20 && curl http://localhost:4000/api/v1/instance + +su pleroma -s $SHELL -lc "./bin/pleroma stop" +</code></pre> + +<h3>Setup and Configure Nginx</h3> +<p> +For your domain name you'll need to install an SSL certificat for security. There's a guide <a href="https://landchad.net/certbot.html">here that will walk you through the steps.</a> + +Once you've got your cert setup copy over the Nginx configuration with the below command: +</p> + +<pre><code>cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf + +ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf +</code></pre> + +<p> +Next you'll need to go into the <strong>etc/nginx/sites-enabled/pleroma.conf</strong> file and replace <strong>example.tld</strong> with your domain name. In my case my pleroma instance is shiteposting.com. +A quick tip is you can verify if the config is valid with the below command: +</p> + +<pre><code>nginx -t +</code></pre> + +<p> +Then simply restart the Nginx service with this command: +</p> + +<pre><code>sudo systemctl restart nginx +</code></pre> + + +<h3>Setting up the service</h3> + +<p> +Pleroma itself runs on a SystemD service similar to other things running on your server like Nginx. To start the service up run the below commands: +</p> + +<pre><code>cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service + +systemctl start pleroma +systemctl enable pleroma +</code></pre> + +<p> +If everything worked then when you go to your domain in the web browser you should see a bare-bones Pleroma instance. +</p> + + +<h3>Creating an Admin User</h3> + +<p>You'll be able to create new accounts on the Pleroma instance in the login section on the website but the easiest way to setup an admin account is with the CLI. Simply run the below command replaced with your username: +</p> + +<pre><code>cd /opt/pleroma + +su pleroma -s $SHELL -lc "./bin/pleroma_ctl user new <USERNAME> <USERNAME>@<YOURDOMAIN> --admin" +</code></pre> + +<p> +If you run into any issues then <a href="https://docs-develop.pleroma.social/backend/installation/otp_en/">feel free to checkout the documentation</a> or send me an email or message. My details are below. +</p> + +<p> +<b>My Website:</b> https://biasedriot.co +</p> + +<p> +<b>My Youtube Channel:</b> https://www.youtube.com/channel/UCehh50T6qtDpt_kEUF33GJw +</p> + +<p> +<b>Monero:</b> 84Y4FZiTbLeR5qc1fBrBhB1yq5agKtEdoixq2w1ysXJv486MiBCz3czGT15bqeXDPpdLoNyF93inxY3BCk6g8mrDMNKoArS +</p> +<p> +<b>Bitcoin:</b> 1Dmn9jEtWAhdLk1HHWkUVNeDdAaBCwNajm +</p> + </main> + <footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><a href="index.html"><img src="pix/chad.gif" alt="chad"></a></li><li><a href="rss.xml"><img src="pix/rss.svg" alt="RSS"></a></li><li><a href="pix/btc.png"><img src="pix/btc.svg" alt="BTC"></a></li><li><a href="pix/xmr.png"><img src="pix/xmr.svg" alt="XMR"></a></li><li><a href="https://github.com/lukesmithxyz/landchad"><img src="pix/git.svg" alt="Github"></a></footer> +</body> +</html> |
