PiFaaS is a lightweight Function-as-a-Service (FaaS) platform designed with a low footprint in mind (e.g., Raspberry Pi Zero). It enables you to deploy, run, schedule, and log small scripts (Python, Bash, etc.) remotely over HTTP — perfect for edge automation and IoT projects.
-
Run scripts on demand Execute any script via
POST /with optional input payload. -
Schedule scripts Create and remove cron jobs remotely using HTTP endpoints (
POST /schedule/,DELETE /schedule/). -
List schedules Retrieve all scheduled functions and their cron expressions via
GET /schedule. -
View logs Capture and fetch function output logs with
GET /logs/. -
Minimal dependencies Pure Python 3, no heavy dependencies, runs efficiently on Raspberry Pi Zero.
- Linux OS
- Python 3 installed
- cron installed and running (for scheduling scripts)
-
Clone or copy the
pi_faas_server.pyscript to your Raspberry Pi Zero. -
Create required directories:
mkdir functions logs
-
Place your function scripts inside the
functions/directory and make them executable:chmod +x functions/hello.py
-
Run the server:
python3 pi_faas_server.py
The server listens on port 8080 by default.
curl -X POST http://<pi-zero-ip>:8080/hello.py -d "optional input data"Schedule hello.py to run every 5 minutes:
curl -X POST http://<pi-zero-ip>:8080/schedule/hello.py -d "*/5 * * * *"curl http://<pi-zero-ip>:8080/schedulecurl -X DELETE http://<pi-zero-ip>:8080/schedule/hello.pycurl http://<pi-zero-ip>:8080/logs/hello.py- Scripts must be executable (
chmod +x). - Place scripts inside the
functions/directory. - Scripts can be any executable (Python, shell, etc.).
- Input payload (POST request body) is passed to the script’s stdin.
- This server does not implement authentication or encryption — only use on trusted or private networks.
- Be careful what scripts you deploy to avoid security risks.
- Cron jobs are managed per user using the current user’s crontab.
- Logs are stored in
logs/with.logextension, appending output with timestamps.
MIT License — feel free to adapt and use freely.