02.23.21

Gemini version available ♊︎

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

Posted in Free/Libre Software, Servers at 8:33 pm by Dr. Roy Schestowitz

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/

Share in other sites/networks: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Reddit
  • email

Decor ᶃ Gemini Space

Below is a Web proxy. We recommend getting a Gemini client/browser.

Black/white/grey bullet button This post is also available in Gemini over at this address (requires a Gemini client/browser to open).

Decor ✐ Cross-references

Black/white/grey bullet button Pages that cross-reference this one, if any exist, are listed below or will be listed below over time.

Decor ▢ Respond and Discuss

Black/white/grey bullet button If you liked this post, consider subscribing to the RSS feed or join us now at the IRC channels.

DecorWhat Else is New


  1. Links 07/02/2023: Fedora 39 Development Plans Outlines

    Links for the day



  2. IRC Proceedings: Monday, February 06, 2023

    IRC logs for Monday, February 06, 2023



  3. Links 06/02/2023: Escuelas Linux 8.0 and Many Political Issues

    Links for the day



  4. Links 06/02/2023: Sparky 6.6 and IPFire 2.27 – Core Update 173

    Links for the day



  5. Taking Back Control or Seizing Autonomy Over the News Cycle (Informing People, Culling the Marketing)





  6. Reality Versus Fiction: EPO Insiders Versus EPO Web Site and UPC 'Churnalists'

    The "official" sources of the European Patent Office (EPO), as well as the sedated "media" that the EPO is bribing for further bias, cannot tell the truth about this very large institution; for proper examination of Europe's largest patent office one must pursue the interpretation by longtime veterans and insiders, who are increasingly upset and abused (they're being pressured to grant patents in violation of the charter of the EPO)



  7. Links 06/02/2023: Linux 6.2 RC7 and Fatal Earthquake

    Links for the day



  8. IRC Proceedings: Sunday, February 05, 2023

    IRC logs for Sunday, February 05, 2023



  9. Links 05/02/2023: Wayland in Bookworm and xvidtune 1.0.4

    Links for the day



  10. Links 05/02/2023: Pakistan Blocks Wikipedia, Musharraf Dies

    Links for the day



  11. IRC Proceedings: Saturday, February 04, 2023

    IRC logs for Saturday, February 04, 2023



  12. Links 04/02/2023: FOSDEM Happening and Ken Thompson in SoCal Linux Expo

    Links for the day



  13. 2023 is the Year Taxpayers' Money Goes to War and Energy Subsidies, Not Tech

    Now that a lot of powerful and omnipresent ‘tech’ (spying and policing) companies are rotting away we have golden opportunities to bring about positive change and maybe even recruit technical people for good causes



  14. Getting Back to Productive Computer Systems Would Benefit Public Health and Not Just Boost Productivity

    “Smartphoneshame” (shaming an unhealthy culture of obsession with “apps”) would potentially bring about a better, more sociable society with fewer mental health crises and higher productivity levels



  15. Links 04/02/2023: This Week in KDE and Many More Tech Layoffs

    Links for the day



  16. Dotcom Boom and Bust, Round 2

    The age of technology giants/monopolies devouring everything or military-funded (i.e. taxpayers-subsidised) surveillance/censorship tentacles, in effect privatised eyes of the state, may be ending; the United States can barely sustain that anymore and raising the debt ceiling won't solve that (buying time isn't the solution)



  17. Society Would Benefit From a Smartphoneshame Movement

    In a society plagued by blackmail, surveillance and frivolous lawsuits it is important to reconsider the notion of “smart” phone ownership; these devices give potentially authoritarian companies and governments far too much power over people (in the EU they want to introduce new legislation that would, in effect, ban Free software if it enables true privacy)



  18. IRC Proceedings: Friday, February 03, 2023

    IRC logs for Friday, February 03, 2023



  19. IRC Proceedings: Thursday, February 02, 2023

    IRC logs for Thursday, February 02, 2023



  20. Links 03/02/2023: Proton 7.0-6 Released, ScummVM 2.7 Testing

    Links for the day



  21. Links 03/02/2023: OpenSSH 9.2 and OBS Studio 29.0.1

    Links for the day



  22. Links 03/02/2023: GNU C Library 2.37

    Links for the day



  23. Sirius Finished

    Yesterday I was sent a letter approving my resignation from Sirius ‘Open Source’, two months after I had already announced that I was resigning with immediate effect; they sent an identical letter to my wife (this time, unlike before, they remembered to also change the names!!)



  24. The Collapse of Sirius in a Nutshell: How to Identify the Symptoms and Decide When to Leave

    Sirius is finished, but it's important to share the lessons learned with other people; there might be other "pretenders" out there and they need to be abandoned



  25. Links 03/02/2023: WINE 8.1 and RapidDisk 9.0.0

    Links for the day



  26. Links 02/02/2023: KDE Gear 22.12.2 and LibreOffice 7.5

    Links for the day



  27. Linux News or Marketing Platform?

    Ads everywhere: Phoronix puts them at the top, bottom, navigation bar, left, and right just to read some Microsoft junk (puff pieces about something that nobody other than Microsoft even uses); in addition there are pop-ups asking for consent to send visitors’ data to hundreds of data brokers



  28. Daily Links at Techrights Turn 15, Time to Give Them an Upgrade

    This year we have several 15-year anniversaries; one of them is Daily Links (it turned 15 earlier this week) and we've been working to improve these batches of links, making them a lot more extensive and somewhat better structured/clustered



  29. Back to Focusing on Unified Patent Court (UPC) Crimes and Illegal Patent Agenda, Including the EPO's

    The EPO's (European Patent Office, Europe's second-largest institution) violations of constitutions, laws and so on merit more coverage, seeing that what's left of the "media" not only fails to cover scandalous things but is actively cheering for criminals (in exchange for money)



  30. European Patent Office Staff Votes in Favour of Freedom of Association (97% of Voters in Support)

    The Central Staff Committee (CSC) at the EPO makes a strong case for António Campinos to stop breaking and law and actually start obeying court orders (he’s no better than Benoît Battistelli and he uses worse language already)


RSS 64x64RSS Feed: subscribe to the RSS feed for regular updates

Home iconSite Wiki: You can improve this site by helping the extension of the site's content

Home iconSite Home: Background about the site and some key features in the front page

Chat iconIRC Channel: Come and chat with us in real time

Recent Posts