Your network blocks the Lichess assets!

lichess.org
Donate

@ChessBoard234 – How can I add Stockfish and run 24/7?

Need help with my bot @ChessBoard234 – Stockfish, seeks & 24/7 hosting

Hi everyone!

I'm the creator of @ChessBoard234, a Lichess bot I've been building with a lot of passion.
My main computer is broken right now, so I'm developing everything on an Android phone using Pydroid 3 (a Python IDE). Despite the limitations, my bot already does quite a bit:

  • Accepts challenges and plays 7 variants (Standard, Chess960, Atomic, Crazyhouse, Racing Kings, Antichess, 3‐Check).
  • Joins team tournaments automatically.
  • Has custom chat commands, greets opponents, says goodbye, and even talks in the spectator room.
  • Uses Cloud Eval for openings and a built‐in engine (Sunfish) as a fallback.

However, I have a dream: I want @ChessBoard234 to play with the strength of Stockfish (3500 ELO), to challenge other bots automatically (seeks), and to run 24/7 without depending on my phone.

I've hit several technical walls and would love to hear your ideas or advice:


1. Stockfish on Android
My bot runs inside Pydroid 3 (Python on Android). I tried downloading pre‐compiled Stockfish binaries for ARM64, but I always get “Exec format error” or they simply don't start. Termux is not an option for me (Play Store restrictions).
Does anyone know a Stockfish binary (or any UCI engine) that actually works on Android without needing to compile it yourself?


2. Seeks without the board:play scope
My API token has bot:play, but not board:play, and apparently Lichess doesn't let me add that scope from the web interface. I've tried using the challenge API (/api/challenge/{username}) to challenge other bots, but sometimes I get 400 errors.
Is there a way to emulate a seek, or to get the board:play permission for a bot?


3. Free 24/7 hosting
At the moment @ChessBoard234 is only online when my phone is on. Do you know any free service (Replit, PythonAnywhere, Fly.io, etc.) that can host a Python script and keep a Lichess bot alive permanently? I'm worried about execution time limits and disconnections.


4. A nice discovery!
While researching, I found that the public Lichess analysis API (https://lichess.org/api/analysis?fen=...) returns Stockfish's best move without any token. I'm using it as a workaround and the playing level has improved a lot. Thank you Lichess for that tool! However, I'd love to integrate a local Stockfish to reduce latency and not depend on the network all the time.


Any suggestion, link, tutorial, or even just some encouragement would be amazing. I know I'm a newbie, but I'm really excited about this project. Thank you for reading! ️

***Need help with my bot @ChessBoard234 – Stockfish, seeks & 24/7 hosting*** Hi everyone! I'm the creator of **@ChessBoard234**, a Lichess bot I've been building with a lot of passion. My main computer is broken right now, so I'm developing everything on an Android phone using **Pydroid 3** (a Python IDE). Despite the limitations, my bot already does quite a bit: * Accepts challenges and plays **7 variants** (Standard, Chess960, Atomic, Crazyhouse, Racing Kings, Antichess, 3‐Check). * Joins team tournaments automatically. * Has custom chat commands, greets opponents, says goodbye, and even talks in the spectator room. * Uses Cloud Eval for openings and a built‐in engine (Sunfish) as a fallback. However, I have a dream: I want @ChessBoard234 to play with the strength of **Stockfish** (3500 ELO), to **challenge other bots automatically** (seeks), and to run **24/7** without depending on my phone. I've hit several technical walls and would love to hear your ideas or advice: --- ***1. Stockfish on Android*** My bot runs inside Pydroid 3 (Python on Android). I tried downloading pre‐compiled Stockfish binaries for ARM64, but I always get “Exec format error” or they simply don't start. Termux is not an option for me (Play Store restrictions). **Does anyone know a Stockfish binary (or any UCI engine) that actually works on Android without needing to compile it yourself?** --- ***2. Seeks without the `board:play` scope*** My API token has `bot:play`, but not `board:play`, and apparently Lichess doesn't let me add that scope from the web interface. I've tried using the challenge API (`/api/challenge/{username}`) to challenge other bots, but sometimes I get 400 errors. **Is there a way to emulate a seek, or to get the `board:play` permission for a bot?** --- ***3. Free 24/7 hosting*** At the moment @ChessBoard234 is only online when my phone is on. **Do you know any free service (Replit, PythonAnywhere, Fly.io, etc.) that can host a Python script and keep a Lichess bot alive permanently?** I'm worried about execution time limits and disconnections. --- ***4. A nice discovery!*** While researching, I found that the **public Lichess analysis API** (`https://lichess.org/api/analysis?fen=...`) returns Stockfish's best move without any token. I'm using it as a workaround and the playing level has improved a lot. **Thank you Lichess for that tool!** However, I'd love to integrate a local Stockfish to reduce latency and not depend on the network all the time. --- Any suggestion, link, tutorial, or even just some encouragement would be amazing. I know I'm a newbie, but I'm really excited about this project. Thank you for reading! ️
<Comment deleted by user>

Well since your bot runs on PyDroid is isn't possible to put a piece of code on PyDroid and make your bot run forever but here are some other working ways

STEP 1:
import os

# Do not hardcode your token
LICHESS_TOKEN = os.environ.get("LICHESS_BOT_TOKEN")

STEP 2:
Chose a free cloud host I would go with either Render or PythonAnywhere

STEP 3:

Download the Git official client or use a browser.
Create a private repository on GitHub.
Upload your PyDroid .py file and a requirements.txt file listing your dependencies
STEP 4:

Connect your GitHub account to Render or PythonAnywhere.
Select your repository.
Navigate to the Environment Variables settings in your host dashboard.
Add LICHESS_BOT_TOKEN as the key and paste your actual Lichess token as the value.
Click Deploy.

Hope this helps :-)

Well since your bot runs on PyDroid is isn't possible to put a piece of code on PyDroid and make your bot run forever but here are some other working ways STEP 1: import os # Do not hardcode your token LICHESS_TOKEN = os.environ.get("LICHESS_BOT_TOKEN") STEP 2: Chose a free cloud host I would go with either Render or PythonAnywhere STEP 3: Download the Git official client or use a browser. Create a private repository on GitHub. Upload your PyDroid .py file and a requirements.txt file listing your dependencies STEP 4: Connect your GitHub account to Render or PythonAnywhere. Select your repository. Navigate to the Environment Variables settings in your host dashboard. Add LICHESS_BOT_TOKEN as the key and paste your actual Lichess token as the value. Click Deploy. Hope this helps :-)

https://lichess.org/@/thibault/blog/how-to-create-a-lichess-bot/FuKyvDuB

If you're not writing a homemade chess engine, or a program that plays chess, then you have no reason to make a Lichess bot account. None.

If you just want to play stockfish, you can already do it from the Lichess homepage.

https://lichess.org/@/thibault/blog/how-to-create-a-lichess-bot/FuKyvDuB >If you're not writing a homemade chess engine, or a program that plays chess, then you have no reason to make a Lichess bot account. None. > >If you just want to play stockfish, you can already do it from the Lichess homepage.

@AtomicChessSensei said ^

https://lichess.org/@/thibault/blog/how-to-create-a-lichess-bot/FuKyvDuB

If you're not writing a homemade chess engine, or a program that plays chess, then you have no reason to make a Lichess bot account. None.

If you just want to play stockfish, you can already do it from the Lichess homepage.

I know, but I am creating

@AtomicChessSensei said [^](/forum/redirect/post/k4Aw6M7d) > https://lichess.org/@/thibault/blog/how-to-create-a-lichess-bot/FuKyvDuB > > >If you're not writing a homemade chess engine, or a program that plays chess, then you have no reason to make a Lichess bot account. None. > > > >If you just want to play stockfish, you can already do it from the Lichess homepage. I know, but I am creating

@RoyalJockey said ^

Well since your bot runs on PyDroid is isn't possible to put a piece of code on PyDroid and make your bot run forever but here are some other working ways

STEP 1:
import os

# Do not hardcode your token
LICHESS_TOKEN = os.environ.get("LICHESS_BOT_TOKEN")

STEP 2:
Chose a free cloud host I would go with either Render or PythonAnywhere

STEP 3:

Download the Git official client or use a browser.
Create a private repository on GitHub.
Upload your PyDroid .py file and a requirements.txt file listing your dependencies
STEP 4:

Connect your GitHub account to Render or PythonAnywhere.
Select your repository.
Navigate to the Environment Variables settings in your host dashboard.
Add LICHESS_BOT_TOKEN as the key and paste your actual Lichess token as the value.
Click Deploy.

Hope this helps :-)

Thanks a lot for the clear steps, @RoyalJockey! I'm going to try PythonAnywhere.

The big bonus I didn't expect is that by moving to a cloud Linux host, I can finally run a normal Stockfish binary without the "Exec format error" I was getting on Android. That solves two problems at once.

One technical question: once I've got the stockfish binary on PythonAnywhere, what's the cleanest way to call it from Python? I've seen examples using chess.engine.SimpleEngine.popen_uci("./stockfish"). Is that the recommended approach, or should I place the binary somewhere specific and use an absolute path? Also, how could I configure the beings?

Thanks again – really appreciate your help! ️

@RoyalJockey said [^](/forum/redirect/post/TrgkynSd) > Well since your bot runs on PyDroid is isn't possible to put a piece of code on PyDroid and make your bot run forever but here are some other working ways > > STEP 1: > import os > > # Do not hardcode your token > LICHESS_TOKEN = os.environ.get("LICHESS_BOT_TOKEN") > > STEP 2: > Chose a free cloud host I would go with either Render or PythonAnywhere > > STEP 3: > > Download the Git official client or use a browser. > Create a private repository on GitHub. > Upload your PyDroid .py file and a requirements.txt file listing your dependencies > STEP 4: > > Connect your GitHub account to Render or PythonAnywhere. > Select your repository. > Navigate to the Environment Variables settings in your host dashboard. > Add LICHESS_BOT_TOKEN as the key and paste your actual Lichess token as the value. > Click Deploy. > > Hope this helps :-) Thanks a lot for the clear steps, @RoyalJockey! I'm going to try PythonAnywhere. The big bonus I didn't expect is that by moving to a cloud Linux host, I can finally run a normal Stockfish binary without the "Exec format error" I was getting on Android. That solves two problems at once. One technical question: once I've got the `stockfish` binary on PythonAnywhere, what's the cleanest way to call it from Python? I've seen examples using `chess.engine.SimpleEngine.popen_uci("./stockfish")`. Is that the recommended approach, or should I place the binary somewhere specific and use an absolute path? Also, how could I configure the beings? Thanks again – really appreciate your help! ️

@GatoChess89 said ^

I know, but I am creating

You said that you are going to use Stockfish.

@GatoChess89 said [^](/forum/redirect/post/T6WoIqZh) > I know, but I am creating You said that you are going to use Stockfish.

@AtomicChessSensei said ^

I know, but I am creating

You said that you are going to use Stockfish.

And?

@AtomicChessSensei said [^](/forum/redirect/post/nKk3rgUc) > > I know, but I am creating > > You said that you are going to use Stockfish. And?

@GatoChess89 said ^

I know, but I am creating

You said that you are going to use Stockfish.

And?

Stockfish is an open-source engine that you didn't create. There are hundreds (if not thousands) of bots running Stockfish on Lichess, hence the blog post I linked. If you are interested in chess engines, I encourage you to get into engine development by writing your own instead. There are plenty of great resources online; YouTube is a good place to start.

@GatoChess89 said [^](/forum/redirect/post/ObCAYxHH) > > > I know, but I am creating > > > > You said that you are going to use Stockfish. > > And? Stockfish is an open-source engine that you didn't create. There are hundreds (if not thousands) of bots running Stockfish on Lichess, hence the blog post I linked. If you are interested in chess engines, I encourage you to get into engine development by writing your own instead. There are plenty of great resources online; YouTube is a good place to start.