How to Play Chess in Your Linux Terminal (With Multiplayer Support … – MUO – MakeUseOf
Chess is the original 4X RPGgiving you command of territory and an army, together with a mission to explore and expand across the board, exploit your enemy's weakness, and then exterminate your opponent.
While it's simple to play online chess in a browser, you can also stage a two-player chess game in your terminal, either with an opponent in the same room or via SSH, meaning your opponent could be anywhere in the worldor beyond. Here's how.
Chess is one of the greatest games of all time, with a history going back to the 6th Century Gupta Empire in India. Although the rules have been refined over time, chess has remained popular due to its accessibility, and the cerebral challenge of pitting one person's skills against another.
If you've never played chess before, don't fret; you can easily learn to play Chess on your phone.
Traditionally, chess is a two-player game, played using a physical board with 64 squares, and two armies of 16 pieces.
Before the advent of the internet, if you wanted to play chess with someone who wasn't in the same room as you, each player would have to have their own chess board and communicate their moves via a letter telegram, phone, or a message in the newspaper.
Today, you can use mobile apps to instantly join chess games, or open a web browser and join one of the many online chess sessions on dedicated sites.
But mobile apps can be costly, and not everyone has a computer with a web browseror even a graphical desktop.
With Gambit, you can create a chess game in your terminal, and play with the person sitting next to you. Alternatively, you can serve or join a game over SSH, meaning you can play instantly against anyone in the world.
Gambit is written in Google's Go language, so before you start, make sure that you have Go installed on your Linux system.
If your distro supports Snap, the easiest way to install Go is with:
With Go installed, you can install Gambit with:
This command will install the Gambit binary to ~/go/bin/gambit.
You can make the binary accessible from any terminal location by creating a symbolic link with the ln command:
You can then start Gambit with:
Alternatively, you can install Gambit by cloning its GitHub repository:
Then, use the cd command to navigate to the new directory:
Finally, start Gambit with:
If you're a fan of Snap packages, you can install Gambit with the snap command as follows:
If you've read this far, it's probably safe to say that you know at least the basics of how to play chess.
The game starts as soon as you open Gambit, and you'll see a chess board, complete with representations of the chess pieces in either white or black with a white outline.
When it's your turn to move, click on a piece. You'll see a colored dot representing the spaces your piece can move to. Click on one to move your piece.
Alternatively, if your machine doesn't have a mouse, you can use the keyboard to type out the square the piece you want to move is on, then type out the square onto which you want to move the piece.
The only minor gripe we have with playing chess this way is that the chessboard squares are all black, rather than black and white. This can make it a little difficult to easily visualize paths for your pieces.
If you're playing against an opponent on the same computer, you can press the Ctrl + F key combo to flip the board around to give them a better view of the action.
But if you're sitting next to someone, it's probably just as easy, and slightly more satisfying, to break out a real chess board and set up the pieces. It's in playing remote players that Gambit comes into its own.
Secure Shell (SSH) is a protocol used to connect to remote devices securely, and with it, you can host a chess game with Gambit and have other players connect to it.
Before you start, you'll need to create an SSH key. It's not in the documentation, but Gambit will reject keys created with the RSA algorithm. You'll need to use the newer ECDSA algorithm with a minimum key size of 256 bits to host a chess game over SSH with Gambit.
On the host machine, enter:
Choose whether you want to use a password, and then hit Enter. You can find your new key pair in the "~/.ssh/" directory.
If you're playing against an opponent on a different network, the host will need to open port 53531 on their router and forward connections to the host machine's IP address. This requires you to have some basic knowledge about port forwarding on a router.
To start the Gambit server, enter:
Gambit will start the server on port 53531, and players can connect to the game with:
...where room_name is a name picked by the first player to join.
Back on the host machine, you won't find a chessboard in your existing terminal window. Open a second window or tab, then enter:
You can now play a game against your opponent.
If you know your opponent and schedule regular matches against them, Gambit makes it super easy to create or connect to a match.
If your friends don't play chess, don't use Linux, or if you just don't have any friends, you can play solitaire in your terminal instead!
Read more here:
How to Play Chess in Your Linux Terminal (With Multiplayer Support ... - MUO - MakeUseOf
- Indias VC-backed chess academy churns out champions across the board - Financial Times - March 30th, 2025 [March 30th, 2025]
- Chess champ who hid phone in bathroom stall temporarily banned from game - PennLive - March 30th, 2025 [March 30th, 2025]
- Kirill Shevchenko Receives 3-Year Ban For Cheating Incident, Admits to Hiding Phone - Chess.com - March 30th, 2025 [March 30th, 2025]
- SEE IT: Innovation and international connection at the Chess & Community Conference in Athens - Online Athens - March 30th, 2025 [March 30th, 2025]
- Stratford doctor seeks Democratic nomination for mayoral bid: 'I'm going to transform the town' - CTPost - March 30th, 2025 [March 30th, 2025]
- Webster Women Chess Players Helping Lead the Way to the National Championship - Webster University Newsroom - March 30th, 2025 [March 30th, 2025]
- Liam Hereford Crowned Atomic Chess Champion After Explosive Performance - Chess.com - March 30th, 2025 [March 30th, 2025]
- Sign Of Real Intelligence? Chatbots Cheat At Chess, Too, According To Study - Chess.com - March 30th, 2025 [March 30th, 2025]
- MIKE Addresses Italian Kids Chess Meme Stunt In The Front Row Of His Concert - Stereogum - March 30th, 2025 [March 30th, 2025]
- Free Athens chess and robotics event to feature 'Teen Titans' actor, Zaxby's co-founder - Online Athens - March 30th, 2025 [March 30th, 2025]
- How a Love of Chess Led the CEO of Google's DeepMind to a Career in AI and a Nobel Prize - Entrepreneur - March 30th, 2025 [March 30th, 2025]
- The AI Hype Index: DeepSeek mania, Israels spying tool, and cheating at chess - MIT Technology Review - March 30th, 2025 [March 30th, 2025]
- Thinking differently: Inside Cook County Jails chess program and the wizardry of Coach K - WGN TV Chicago - March 30th, 2025 [March 30th, 2025]
- Chess gaining popularity on The Rock - Kodiak Daily Mirror - March 30th, 2025 [March 30th, 2025]
- Talented Chicago youngsters face off in chess competition - CBS Chicago - March 30th, 2025 [March 30th, 2025]
- The New Yorker Chess Set: Where City Icons Make Their Move - Yanko Design - March 30th, 2025 [March 30th, 2025]
- Happy & proud of what India is achieving in chess - The Times of India - March 30th, 2025 [March 30th, 2025]
- NFL Network's Brain Baldinge: defensive end Abdul Carter 'is going to be a real chess piece' at NFL level | 'The Insiders' - NFL.com - March 30th, 2025 [March 30th, 2025]
- Harikrishna's journey from becoming a Junior Champion to training the World Champions - Chess News | ChessBase - March 30th, 2025 [March 30th, 2025]
- Exclusive | Parents push for chess to be included as a sport in NYC public schools - New York Post - March 15th, 2025 [March 15th, 2025]
- The Guardian view on the chess boom: how rooks and knights captured the world | Editorial - The Guardian - March 15th, 2025 [March 15th, 2025]
- D Gukesh shaves head as offering to God; drops improve in all formats verdict after winless Freestyle Chess run - Hindustan Times - March 15th, 2025 [March 15th, 2025]
- Dorian Thompson-Robinson explains how playing chess helps his decision-making as a QB - Bleeding Green Nation - March 15th, 2025 [March 15th, 2025]
- Bloomington's Hoosier Chess Academy teaches kids to be observant, think critically - The Herald-Times - March 15th, 2025 [March 15th, 2025]
- More Randomness In Chess? MIT Sloan Panel Explores The Future Of The Game - Chess.com - March 15th, 2025 [March 15th, 2025]
- 22-year-old Wetherholt has remarkable poise on field -- and at chess - MLB.com - March 15th, 2025 [March 15th, 2025]
- Carlsen to participate in 'Magnus vs The World' showdown: All you need to know about one-of-a-kind game of chess - Firstpost - March 15th, 2025 [March 15th, 2025]
- Chess Masters: The Endgame Proves That No, Chess Is Not a Spectator Sport - Den of Geek - March 15th, 2025 [March 15th, 2025]
- Chess Masters: The Endgame review so dull its almost unwatchable - The Guardian - March 15th, 2025 [March 15th, 2025]
- 25th European Individual Championship 2025 - The Week in Chess - March 15th, 2025 [March 15th, 2025]
- In another chess move with Microsoft, OpenAI is pouring $12B into CoreWeave - TechCrunch - March 15th, 2025 [March 15th, 2025]
- Vidit to spend honeymoon at chess tournament just like Vishy Anand did - Onmanorama - March 15th, 2025 [March 15th, 2025]
- Eagles QBs Jalen Hurts and Dorian Thompson-Robinson share the same Chess coach - Eagles Wire - March 15th, 2025 [March 15th, 2025]
- Chess Masters: The Endgame review opening gambit is middling TV - The Times - March 15th, 2025 [March 15th, 2025]
- BBC2 series Chess Masters: The Endgame does a 'pathetic disservice' to the game, say viewers - Daily Mail - March 15th, 2025 [March 15th, 2025]
- FIDE extends fee waiver for Rapid and Blitz through 2026 World Chess Federation - FIDE - March 15th, 2025 [March 15th, 2025]
- Freestyle Chess: Magnus Carlsen, D Gukesh among elite chess stars to battle in Paris with $750,000 at sta - The Times of India - March 3rd, 2025 [March 3rd, 2025]
- Prague R5: Wei scores second win in a row - Chess News | ChessBase - March 3rd, 2025 [March 3rd, 2025]
- Chess: England over-65s lead all the way to world senior team gold at Prague - The Guardian - March 3rd, 2025 [March 3rd, 2025]
- Carlsen says no opponent can tempt him to compete in classical World Chess Championship: 'Best moves are discarded' - Firstpost - March 3rd, 2025 [March 3rd, 2025]
- Carlsen's World Famous Jeans Auctioned For $36,100 After Bidding War - Chess.com - March 3rd, 2025 [March 3rd, 2025]
- If Visma-Lease a Bike riders were chess pieces, which would they be? - Escape Collective - March 3rd, 2025 [March 3rd, 2025]
- Howard University Chess Team Breaks Through with Pan-Am Win and Mayoral Proclamation - The Dig - March 3rd, 2025 [March 3rd, 2025]
- NFL fans all say the same thing as Ivanka Trump shares photo of Tua Tagovailoa playing chess with her son - Daily Mail - March 3rd, 2025 [March 3rd, 2025]
- Boris Spassky, Chess Champion Who Lost Match of the Century, Dies at 88 - The New York Times - March 3rd, 2025 [March 3rd, 2025]
- Daughter of Kol couple to represent US in under-12 Chess World Cup - The Times of India - March 3rd, 2025 [March 3rd, 2025]
- Magnus Carlsens controversial jeans sell for $36,100 at auction - The Athletic - The New York Times - March 3rd, 2025 [March 3rd, 2025]
- ChessCafe: The Birmingham venue bringing young people together - BBC.com - March 3rd, 2025 [March 3rd, 2025]
- The Viking Chess Master: Unraveling the Enigma of Magnus Carlsen - Jomfruland.net - March 3rd, 2025 [March 3rd, 2025]
- Waterloo Chess Academy teaches Guelph kids to make their move - Guelph Mercury Tribune - March 3rd, 2025 [March 3rd, 2025]
- Grivas on trapping a piece 2 - Chess News | ChessBase - March 3rd, 2025 [March 3rd, 2025]
- Boris Spassky, Soviet-era chess champion who lost "match of the century" to American Bobby Fischer, dies at 88 - CBS News - March 3rd, 2025 [March 3rd, 2025]
- Why the three-year-old Magnus Carlsen vs Hans Niemann cheating scandal is making waves again - The Indian Express - February 25th, 2025 [February 25th, 2025]
- How BBC Competition Format Chess Masters: The Endgame Is A Love Letter To Producers Daughter - Deadline - February 25th, 2025 [February 25th, 2025]
- "The Best Is Yet to Come": Magnus Carlsen talks with Andrea and Alexandra Botez about love, life, chess and more - Chess News | ChessBase - February 25th, 2025 [February 25th, 2025]
- D Gukeshs chief coach casts doubts on Magnus Carlsens Freestyle Chess projects future: No guarantee in 2 years - Hindustan Times - February 25th, 2025 [February 25th, 2025]
- My Wintersession Experience Making Chess Boards in the Carpentry Shop - Princeton University Admission - February 25th, 2025 [February 25th, 2025]
- Checkmate: How Chess.com Produces Hundreds of Live Broadcasts in the Cloud - Sports Video Group - February 25th, 2025 [February 25th, 2025]
- Who Has The Best Chess Roster At The Esports World Cup? - Chess.com - February 25th, 2025 [February 25th, 2025]
- 17-Year-Old Maurizzi Dominates In Djerba With Spectacular 2900 Performance - Chess.com - February 25th, 2025 [February 25th, 2025]
- Chess grandmaster Magnus Carlsen broke a dress code with jeans. Now he's selling them for charity - The Associated Press - February 25th, 2025 [February 25th, 2025]
- Carlsen Beats Nakamura In Grand Final, Wins 2025 Chessable Masters - Chess.com - February 25th, 2025 [February 25th, 2025]
- Bullet Brawl Feb. 22, 2025: Nakamura Wins 36th Title In 'Back To Work' Brawl - Chess.com - February 25th, 2025 [February 25th, 2025]
- Chess: Carlsen wins again as he qualifies for the $1.5m Saudi Esports World Cup - The Guardian - February 25th, 2025 [February 25th, 2025]
- World No. 1 Magnus Carlsen cannot beat his smartphone in chess - Onmanorama - February 25th, 2025 [February 25th, 2025]
- FIDE Grand Swiss 2025: Prize fund increases to record $855,000, with six new spots for women - FIDE - February 25th, 2025 [February 25th, 2025]
- There Are Rumors Trump Is Working Up to 7D Chess - National Review - February 25th, 2025 [February 25th, 2025]
- Joe Rogan's "unquestioned trust in the establishment" slammed by American chess grandmaster Hans Niemann for "an*l beads" chat... - February 25th, 2025 [February 25th, 2025]
- Eldiyar Orozbaev and Begimai Zairbek Kyzy win 2025 Kyrgyzstan Championship - FIDE - February 25th, 2025 [February 25th, 2025]
- Goryachkina and Tan strike back as Womens Grand Prix heats up in Monaco - FIDE - February 25th, 2025 [February 25th, 2025]
- First Win Of The Year For Two More Titled Tuesday Stars - Chess.com - February 25th, 2025 [February 25th, 2025]
- Gukesh is not good at rapid, blitz chess; he's focused all his studies on classical: Carlsen dissects Indian GM's game - Firstpost - February 25th, 2025 [February 25th, 2025]
- "Chess gives me joy and energy" - Magnus Carlsen and Joe Rogan talk chess - Chess News | ChessBase - February 25th, 2025 [February 25th, 2025]
- Magnus Carlsen offers a backhanded compliment to D Gukesh over his blitz and rapid chess skills - MSN - February 25th, 2025 [February 25th, 2025]
- Chess grandmaster Magnus Carlsen broke a dress code with jeans. Now he's selling them for charity - Gettysburg Times - February 25th, 2025 [February 25th, 2025]
- Research shows AI will try to cheat if it realizes it is about to lose - TechSpot - February 25th, 2025 [February 25th, 2025]
- Fort Pierce City Commission chooses its next city manager - WPBF West Palm Beach - February 25th, 2025 [February 25th, 2025]
- Magnus Carlsen on World Champion Gukesh resigning after 18 moves against Fabiano Caruana: He made a prudent decision - The Indian Express - February 11th, 2025 [February 11th, 2025]
- NFL players are turning to an unlikely hobby to improve their game: Chess - CNN - February 11th, 2025 [February 11th, 2025]
- Chess.com is thinking three moves ahead with its friends and family subscription - Fast Company - February 11th, 2025 [February 11th, 2025]