💾 Archived View for cuppajoe.xyz › tutorials › capsule_tutorial.gmi captured on 2021-12-06 at 14:29:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

Step by step instructions on how to create your own Gemini capsule with an Agate server

Step 1

Rent a VPS - this is better for most people as this method does not open your home network to the internet, which is risky. All your VPS needs is 1 CPU core and 1GB of memory. It really shouldn't cost more than $5/month. Your VPS of choice should have instrucions on how to set this up.

Step 2

Buy a domain name - can cost as little a $1/year. You will want to point you domain name to your server by making your domain's main A record your VPS ip address. This can usually be found in you domain registrar's DNS settings

Step 3

Either with a password or SSH keys, login to your server with the following command:

$ ssh root@<your VPS ip>

Step 4

Create a user specifically for your gemini server.

$ adduser <username of choice>

Create a strong password

Give the new user root privileges

$ usermod -aG sudo <username of choice>

$ logout

Step 5

Log in as the new user you created

$ ssh <username of choice>@<your VPS ip>

Create a directory for your Gemini content

$ mkdir gemini

Create a directory for the Agate binary, which will be responsible for serving your capsule

$ mkdir bin

Create some test contest so we will know it is working

$ cd gemini

$ nano index.gmi

Type some text

Step 6

Download Agate binary - go to the latest release of the agate project on Github and copy the link. This tutorial is for an x86_64 linux distro, so choose the file called agate.x86_64-unknown-linux-gnu.gz

Agate releases (https)

$ cd bin

$ wget <link to latest Agate release>

Unzip the binary

$ gunzip agate.x86_64-unknown-linux-gnu.gz

Make the binary executable

$ chmod +x agate.x86_64-unknown-linux-gnu.gz

Step 7

Create a systemd service for the Agate server

$ nano /etc/systemd/system/agate.service

Copy and paste the following text into the file:

[Unit]

Description=agate

After=network.target

[Service]

User=USER

Type=simple

ExecStart=/home/USER/bin/agate.x86_64-unknown-linux-gnu --certs /home/USER/bin/.certificates --content /home/USER/gemini/ --hostname DOMAIN --lang en-US

[Install]

WantedBy=default.target

There is quite a bit going on at the ExecStart line: the first part is the path to the agate executable. Then the --certs argument is used followed by the path to the hidden .certificates directory. The .certificates directory was created when you unziped the agate binary. Certificates for your Gemini capsule are handled automatically here, so you don't have to worry about them. The --content argument is used to find your Gemini content. The --hostname argument points to the domain you chose.

Step 8

Start the service you just created with this command:

$ sudo systemctl start agate.service

To confirm it is running, use:

$ sudo systemctl status agate.service

And that's it! You just created your very own Gemini capsule. Now you can write whatever you want in it for others to see!