💾 Archived View for darknesscode.xyz › linux › install-gemini-server.gmi captured on 2024-02-05 at 09:34:24. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-05)
-=-=-=-=-=-=-
Several months ago I discovered the **Gemini** protocol in the **HTTP** protocol. I read some articles about it and decide to give it a try and setup my own server.
This is what I did to have up and running my **Gemini Capsule**, I think is not the best way but it works fine.
Before install the server and create the systemd service that we need. First create this directories
mkdir .agate .certs gemini.capsule
All the directories were created in the home user.
First let's create the TLS certificates that we need for our capsule, go to the directory that was created
cd .certs
Now run this command
openssl req -new -subj "/CN=yourdomain.xxx" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 1825 -nodes -out cert.pem -keyout key.pem
Change *yourdamain.xxx* for your domain. The certificates that were created will last 5 year, if that is way to much for just change the days you want
There are several server out there for a Gemini server, I choose **Agate** for its simplicity and lightweight
Download the binary file from
wget https://github.com/mbrubeck/agate/releases/download/v2.3.0/agate.x86_64-unknown-linux-gnu.gz
Unpack the file with
gzip -d agate.x86_64-unknown-linux-gnu.gz
For an easy way to work with that file rename it just to agate
mv agate.x86_64-unknown-linux-gnu agate
Move the binary file to its directory and make the binary executable
mv agate .agate/
sudo chmod +x .agate/agate
Now to work with **Agate** we need to create a systemd service, since I'm usegin a Debian server systemd is present in the system.
sudo vim /etc/systemd/system/agate.service
Copy and past this code in the new file
[Unit] Description=Agate Gemini Server After=network.target [Service] User=USER Type=simple ExecStart=/home/USER/.agate/agate -s --content /home/USER/gemini.capsule/ --key /home/USER/.certs/ [Install] WantedBy=default.target
Change USER for your user name or the server user
To start and enabled the new server just run
sudo systemctl start agate
sudo systemctl enable agate
If everything goes well, now is time to test you new capsule, here are a list of clients. But first we need an index.gmi
I haven't use any of the GUI clients, I like to live in the terminal.
That's it!
----------
----------
© DarknessCode