4 Running in Docker with Apache2
Screem edited this page 5 months ago

Table of Contents


  • A server running a linux distribution (Debian is used in this example).
  • A domain and access to DNS records.
  • Apache2
  • Docker
  • Details of your SMTP server (hostname, email address & password)

Step 0: The Setup

Install Apache and Docker

sudo apt-get install -y apache2 && sudo apt-get install -y docker.io

Ensure the processes for each are running

sudo systemctl status apache2

sudo systemctl status docker

This should show “Active: active (running)” for both services.

Now you can save the below environment (ENV) variables into a 'file_name.env' file.


You’re now ready to being the setup of your pod.

Step 1: Pointing your domain to your server

Simply go into your registrar’s DNS settings for the domain you’d like for your pod and add the below:

Type - A record

Name/Host - @ if you’re wanting to use a domain with no sub-domain (eg. yourdomain.com) or only use the sub-domain component if you want to use a sub-domain (eg. yarn if you want to use the domain yarn.yourdomain.com).

Content: The IP address of the server your pod will be running on.

Type Name Content
A sub or @ xxx.xxx.xxx.xxx

sub or @ → If you're using a sub-domain you only need to populate anything before the first . (eg. a sub-domain of yarn.yarnpods.com would only require yarn to be entered).

xxx.xxx.xxx.xxx → This is the IP of the server you'd like to point your domain to.

Now, edit the hosts file and direct your domain to your server, using the command below:

sudo nano /etc/hosts

Your new entry should look similar to the below example (partly redacted for privacy):        localhost
10.0.xxx.xxx     yarn.yarnpods.com

Step 2: Setting up ProxyPass

Before we go in-depth with ProxyPass, we must first ensure that the required apache2 mods are enabled with the below commands:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo systemctl restart apache2

With these steps done, we can now move onto the ProxyPass setup. Navigate to /etc/apache2/sites-available.

If you’re not planning on running anything else on this server, edit your 000-default.conf file. I prefer using nano, but you can use whichever editor you’d like.

sudo nano 000-default.conf

Edit this file to only include the below:

<VirtualHost *:80>
        ProxyPreserveHost On
        ProxyPass /
        ProxyPassReverse /

Reload apache and you’re all done with ProxyPass!

sudo systemctl reload apache2

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-01-29 01:23:15 AWST; 2 days ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 25189 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
  Process: 766 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
 Main PID: 25193 (apache2)
    Tasks: 11 (limit: 4915)
   Memory: 33.9M
   CGroup: /system.slice/apache2.service
           ├─  786 /usr/sbin/apache2 -k start
           ├─ 2460 /usr/sbin/apache2 -k start
           ├─ 8912 /usr/sbin/apache2 -k start
           ├─12075 /usr/sbin/apache2 -k start
           ├─13372 /usr/sbin/apache2 -k start
           ├─13638 /usr/sbin/apache2 -k start
           ├─14272 /usr/sbin/apache2 -k start
           ├─15204 /usr/sbin/apache2 -k start
           ├─15206 /usr/sbin/apache2 -k start
           ├─15207 /usr/sbin/apache2 -k start
           └─25193 /usr/sbin/apache2 -k start

Step 3: Running your Yarn.social Docker container

To get you Docker container running, simply run the below command and replace all information in <> brackets.

docker run --env-file </path/to/file_name.env> --name <containerName> -d -p 8000:8000 -v </path/to/data:/data> prologic/yarnd yarnd -R -O -A <adminUser> -u <https://yourdomain.tld/>

/path/to/env/file.env → This is the absolute path to the .env file you created in Step 0.

containerName → This will be the name of your docker container.

/path/to/data:/data → This is the directory you’d like your pods Yarn data stored (eg. /home/yarn:/yarn)

adminUser → This is the name of the account you intend to use as your pod’s administrator account.

https://yourdomain.tld/ → This is the domain you would like to use to access your pod (eg. if not using a sub-domain: https://twtxt.net. If using a sub-domain: https://yarn.yarnpods.com/).

Now you can verify this is running by using the command docker ps. A successfully started container will look something like this:

sheldon@red:~$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
HASHED_ID           prologic/yarnd      "/init yarnd -R -O -…"   25 hours ago        Up 25 hours>8000/tcp   yarn.yarnpods.com

Step 4: Register your admin user

Now you can navigate to your pod using your domain. The last step for this setup is simply registering your admin account on your pod.

Navigate to https://yourdomain.tld/register and enter the below:

Username → The username of your admin account.

Password → A strong, unique password for your admin account. It is suggested you use a password manager.

Email address → The email address you’d like to use for your account in the event you need to recover your account.

You can now login to your account and start using your pod!

Step 5: Completion and Next Steps

You’ll notice that your pod is currently empty with no content, unlike other pods. At this point, I would suggest following the below accounts to get started with propagating your pod with content. This can be done via the “Feeds” page by entering the below URLs into the "Follow Feed" tool.

@prologic (https://twtxt.net/user/prologic/twtxt.txt) → Creator of Yarn.social and twtxt.net pod operator.

@screem (https://yarn.yarnpods.com/user/screem/twtxt.txt) → Owner of Yarnpods.com and yarn.yarnpods.com pod operator.

@jlj (https://twt.nfld.uk/user/jlj/twtxt.txt)twt.nfld.uk pod operator.

@eldersnake (https://we.loveprivacy.club/user/eldersnake/twtxt.txt)we.loveprivacy.club pod operator.

@david (https://netbros.com/user/david/twtxt.txt)netbros.com pod operator.


This section will be updated with any troubleshooting guides that may be needed during the installation/first start of your pod.

If you run into a problem through this guide that isn't documented in the troubleshooting guides, please submit an issue.