Bonum Certa Men Certa

How to Set Up a Gemini Server of Your Own, Even on a Simple Single-Board Computer

Gemini Turntable



Summary: Using Agate to start one's own Gemini capsule (self-hosted) is a lot simpler than one might be inclined to believe; this is a detailed HOWTO, hoping to encourage more people to join Gemini space, which is fast-growing and free of garbage

THE one thing that stunned me was how easy it was to set up a Gemini server. A lot simpler than setting up a Web server. The harder part is certificates, but that too is trivial once it's done a couple of times, potentially with errors at first.



Here's a quick recipe for setting up one's own instance and Gemini capsule.

First, create a new user's account. Gemini ought to have its own account, as it'll make things a lot simpler (backup, permissions etc.) and for the sake of this example we'll assume the user account is "gemini" (with home directory /home/gemini)

Then, in the user's top-level (home) directory:

mkdir gemini bin certs

This will set up directories for the capsule, the programs, and the certificates, respectively.

There's not so much left to do now.

Go to the directory gemini (e.g. cd ~/gemini/ or equivalent using a graphical file browser)

In that directory, create or place a file called index.gmi

It can be empty or contain something simple like Hello world! (just to make sure that the server is set up and works)

Now let's get the server software. Go to the bin directory (e.g. cd ~/bin/). For most practical purposes agate (Apache Licence) seems to be OK and it supports quite a few architectures. Unfortunately it's hosted on GitHub (Microsoft), with latest versions shown at the top of this page. If you are not sure what architecture to choose, run uname -a

The correct binary can be downloaded using a Web browser or a tool like wget/curl. That program is quite small and needs to be placed in bin in order to stay consistent with this manual.

Unpack and set 'executable' (x) permission for the file, e.g. using

gunzip [binary_file]
chmod +x [binary_file]


Depending on the name of the binary file in question.

For my ARM SBC it is gunzip agate.armv7-unknown-linux-gnueabihf.gz and chmod +x agate.armv7-unknown-linux-gnueabihf

All the pieces are now in place except the certificate and the service setup.

On a systemd-based operating system create a new file at /etc/systemd/system/agate.service

It should look something like this:

[Unit]
Description=agate
After=network.target



[Service] User=gemini Type=simple ExecStart=[your settings]

[Install] WantedBy=default.target


Wherein [your settings] ties together the program, the root directory for hosting (capsule), and the certificate.

In the case of Techrights on ARM, it's something as follows:

/home/gemini/bin/agate.armv7-unknown-linux-gnueabihf -s --content /home/gemini/gemini/ --key /home/gemini/certs/key.pem --cert /home/gemini/certs/cert.pem --hostname your hostname --lang en-GB

In our case, your hostname is gemini.techrights.org (how you set up your hostname may depend on how you manage domains and where). That hostname needs to point to your device's IP address.

All that's left now is certificate setup and service initiation.

Go to the certificates directory (e.g. cd ~/certs/) as this will likely involve the command line (unless you have some graphical tools that do the same).

A simple self-signed certificate ought to be sufficient:

openssl req -new -subj "/CN=your hostname" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 365 -nodes -out cert.pem -keyout key.pem

That's for 1 year. It can be set to anything.

The command then leaves the two files required by the service/server, namely cert.pem and key.pem. These can be modified and regenerated at any time, so there's no need to worry if at any point they're wrongly generated or made for the 'wrong' domain.

To get it all started, assuming systemd:

sudo systemctl restart agate
sudo systemctl enable agate


Use a Gemini browser (or Web proxy) to then test access to the hostname over gemini:// (it will attempt to connect over port 1965, so make sure there's no firewall standing in the way at the level of the device or the network it is in). This is pretty much it, with the exception of variation for non-systemd systems. All that systemd does is, it starts the server using the suitable command and arguments, even after restarts. That command can instead be run manually, or set up for any init system of choice. The hardest part is setting up the domain, generating the key/certificate correctly, and then lowering the filters (if any) to allow access over port 1965.

We don't typically do HOWTO-type articles, but for this one we make an exception. If you get stuck, ask us in IRC for help. Gemini needs to grow and for faster growth we need to help one another.

Agate is quite small and simple. As of the time of writing, it does not support server-side CGI scripts (for something like in-capsule search), but Gemini ought to be kept light and simple anyway; we're not trying to just replicate the bloated Web.

Credit: Chris Were, for some initial notes and suggestions. gemini://chriswere.uk/

Recent Techrights' Posts

Twitter as X-Rated Hatred: Criticising Microsoft is Not OK, Calling for Beheadings (With Bounties on People's Heads) is OK
Twitter automation missed 'hit job' advertising
Balancing Activism Against (or With) Basic Necessities and Daniel Cantarín on Our Collective Battle for Software Freedom Around the World
"I'm VERY angry about lots of stuff happening here in Argentina, all of it shielded behind the word "freedom"."
 
Links 16/08/2024: YouTube Bans and Surveillance Expanded
Links for the day
We Were Right All Along and the Collaborators of Microsoft Helped Competition Crimes of Microsoft
Once again vindicated regarding UEFI "secure boot"
[Meme] The New Windows Slogan
stat me up
Addendum: Associate's Notes on Free Software as a Labour Issue and the Connectivity Swindles
these are related issues/causes
Microsofters Infiltrating Roles of Authority and Government Positions to Protect Microsoft and to FUD Microsoft's Competition
friends of Microsofters who bully me and my wife
Links 16/08/2024: UK Skills Deficit and Kim Dotcom to be Extradited to the US (for Doing the Same Stuff GAFAM Does)
Links for the day
Gemini Links 16/08/2024: Overgeneralisation and Games
Links for the day
Russia's Yandex 5 Times Bigger Than Microsoft... in Ukraine
They'd rather rely on the Kremlin than on Microsoft
[Meme] Gemini is Different, So What?
different, not worse
Now It's "Official": Over 4,000 Known Gemini Capsules in Lupa
For the first time ever
Clown Computing
Reprinted with permission from Dr. Andy Farnell
[Meme] What Freedom Means to IBM
Free labou
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, August 15, 2024
IRC logs for Thursday, August 15, 2024
From 99% in 2012 to 27% in 2024: How Microsoft Lost Georgia
What we're seeing is a migration from Windows to other platforms, notably GNU/Linux
To Understand Cisco's Mass Layoffs Look at the Company's Soaring Debt (Same at Microsoft)
Look what's happening to Intel - down almost 60% since the start of the year, 57% to be precise
Windows Flying Low at 25%
It's another all-time low
[Meme] Long Texts You Never Bother Reading (Because Life is Too Short, Unlike Those Texts)
The devil is in the terms of service
Links 15/08/2024: Monkeypox Hysteria and Modern Homesteaders Living Off the Grid
Links for the day
Gemini Links 15/08/2024: Confession of a Convention Game Master and Some Release nostalgia
Links for the day
Congratulations to Romania, Where Windows is Now "Minority Market Share" Platform
Time will tell if GNU/Linux can pass 5% on the desktop/laptop "form factor" there
Why It Matters That 4,000 Gemini Capsules Are Known to Lupa and Why Gemini Protocol Matters to Us
I have no doubt Gemini Protocol will continue to expand because it solves a real problem
Links 15/08/2024: Avast Surveillance Scandal Unsolved and Facebook Still Censors Terror Sympathisers
Links for the day
Daniel Cantarín's Response to Alexandre Oliva's Talk on Achieving Software Freedom in the Age of Platform Decay
Soylent News caught up with the series
4,000 Gemini Capsules
it's basically one capsule short of 4,000
"Microsoft is a Sponsor of The New Stack."
Many articles turn out to be just ads
New Highs for Android in Russia, But It's Reportedly Working on Its Own Linux-Based Operating Systems (GAFAM-Free)
statCounter isn't equipped to properly parse user agents or to keep up
Upcoming Series: Terms of Service (TOS) Under the Microscope, FSF Party, GitHub Scandals, Clowns, and More
Right now we have way more material than we have time to cover. But that's a good thing.
Gemini Links 15/08/2024: Lies of Therapy and Web Applications
Links for the day
Software Freedom in Perspective - Part 5 - When Richard Stallman Came to Argentina
It might seem a bit harsh, but a discussion at the end of this series will tie things together and explain why those things were said
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, August 14, 2024
IRC logs for Wednesday, August 14, 2024
Russia develops an alternative to Android and iOS | News.az
Russia already has several of its own operating systems
Links 14/08/2024: Ecology and War Inside Russia
Links for the day
Daniel Pocock - Use of Technology in European Parliament Election Campaign (Public Talk)
It starts in 4 hours
Android About to Fly Past Windows in Portugal
Perhaps by month's end or next month Portugal will be orange (Android majority)
How OpenAI Will Decrease the Losses
You have no losses when you have no users left
Giving Control to Microsoft is Always a Dire, Huge Mistake
Microsoft is known for buying things and sabotaging things, not for creating things
Founders That Sell Their Company to Microsoft Speak Out
"Microsoft's closure of Arkane Austin in May was one of the more shocking events of the past couple of years"
In Chile, Microsoft's Web Browser (a Chrome Copycat) Fell to 3.6%, About the Same as Firefox and Opera and Less Than Safari, Yandex Browser, Google Chrome
It does not look like Chileans fancy Microsoft's browser. They go out of their way to use something else, even on Windows.
Software Freedom in Perspective - Part 4 - Daniel on Linux-based Mobile Platforms in LATAM (Latin America)
GNU, Linux, and mobile
Almost Nothing of Invidious Left Online (YouTube is Attacking Gateways)
what it looks like at this very moment
Gemini Links 14/08/2024: Funeral for an E-reader and a Mother Wants a Laptop
Links for the day
Links 14/08/2024: 8 Years of GDPR and Ridicule of "Hey Hi" (AI) Hype
Links for the day
This is How You Give Microsoft More Control Over LibreOffice Both as Software and as a Project
Didn't the Document Foundation learn from prior Microsoft Store scandals connected to LibreOffice?
"Heroes of Fedora" Are Just Salaried Employees of IBM (But "Community" is Just Sounding a Lot Nicer)
A real community would not allow IBM a majority
YouTube Has Thrown Free Software Users Into a Crisis
For many Free software users, who rely on Invidious, YouTube is nearly dead already
[Meme] "New Chapter in the FSF."
We expect to have some coverage from this week's event
There is No I in "GAFAM" and Soon There Won't be I At All (Like Novell Vanished, Not Overnight, as It Took Over a Decade)
Intel is going through the biggest crisis in its entire history
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, August 13, 2024
IRC logs for Tuesday, August 13, 2024
It's a "sm0l" World and It Won't Outsource to the Pentagon Anymore
As many people aren't interested in a new PC - or simply cannot afford one - we can expect leaner operating systems to gain further
Software Freedom in Perspective - Part 3 - GNU/Linux in Argentinian Desktops/Laptops
Daniel explains why many years ago many PCs shipped with GNU/Linux and that there was an economic reason for it. At least in Argentina.
Tivoisation and Decommodification in Clown Computing
Some firms or organisations lost sight of what "servers" or "hosting" even mean
The News Vacuum
The problem is worse than just an absence of reporting
x86 Lowered the Standards of Hardware Products
A lot of it is just hacks and cheats that help fake performance