This is an installation tutorial for the CAM-AI Server on a Raspberry Pi 4 (Minimum 4 GB of internal RAM) with Raspberry Pi OS 12 (bookworm) 64bit. For Raspi we recommend installing CAM-AI on a freshly installed Raspi-OS. You can prepare your Raspi (OS installation etc.) following the instructions in this separate tutorial.
Alternatively you can install the CAM-AI server on a PC with Debian OS Version 12. You can prepare your PC (OS installation etc.) following the instructions in this separate tutorial.
Continue here to proceed on any system: First you give the cam_ai user the privilege to launch server shutdown and reboot without a password. This is needed to end or update the program from the web interface:
sudo visudo -f /etc/sudoers.d/shutdown_privilege
You add the following context to the empty file. When done, save and leave:
cam_ai ALL=(root) NOPASSWD: /sbin/
shutdown
Next is getting the CAM-AI installer program and launching it:
wget https://raw.githubusercontent.com/ludgerh/cam-ai/main/cam-ai-setup.py
python cam-ai-setup.py
This installation program will ask you a couple of questions first:
Here are the answers:
- Localhost: Hit “Enter” for no if you do not plan to access your server from a browser on the same machine.
- Internal IP: Enter “cam-ai-raspi”, if this is your server’s name. If not, enter the right server name or the server’s IP address.
- Database password: This is the password for the access to the database. Select one and write it down, in case you need it later.
To start the server on a Raspi type:
./runserver.sh raspi
To start the server on a PC type:
./runserver.sh pc
Log in
From another PC in the same network, you can now log in by giving your browser:
http://cam-ai-raspi:8000/
If your server has a network name different from “cam-ai-raspi” (“cam-ai-debian for example), use that or the IP address. The initial login information is user=admin password=cam-ai-123.
Done.
What’s next?
- If you plan to train your AI yourself, the CAM-AI server will need a connection to another server that is capable of doing the AI training work. Get an account from our fast server in the cloud. Here is how. Write down your new username and password. You will need it later.
- To connect your camera to your server and your Server to the AI server, you need to do a basic server setup.
- Optional: If you want to use this server for daily use, it makes sense to add the autostart feature and make it autonomous from your PC’s terminal. Here is how.
- Optional: If you want to access your server from outside your local area network, you need to configure HTTPS. Here is how.