How to Install MotionEye on Raspberry Pi (Video Surveillance)

1. Download the MotionEye software package:

First, you will need to download the MotionEye software package. You can do this by visiting the MotionEye website and downloading the latest version of the software.

2. Install the MotionEye software package:

Once you have downloaded the MotionEye software package, you will need to install it on your Raspberry Pi. To do this, open a terminal window and type the following command:

sudo apt-get install motioneye

3. Configure the MotionEye software package:

Once the MotionEye software package has been installed, you will need to configure it. To do this, open a terminal window and type the following command:

sudo motioneye-config

This will open the MotionEye configuration utility. Here, you can configure various settings such as the camera type, resolution, frame rate, and more.

4. Start the MotionEye software package:

Once you have configured the MotionEye software package, you can start it by typing the following command in a terminal window:

sudo motioneye

This will start the MotionEye software package and you should now be able to access it from your web browser.

5. Access the MotionEye web interface:

Once the MotionEye software package has been started, you can access the web interface by typing the following address into your web browser:

http://localhost:8765

This will open the MotionEye web interface where you can view the live video feed from your camera. You can also configure various settings from here.

MotionEye is a web interface for the Motion service, which is commonly used on Raspberry Pi to connect, manage, and monitor all kinds of cameras. It’s not directly available in the official Raspberry Pi OS repository, so I’ll guide you through the process of installing everything on your Pi in this step-by-step tutorial.

MotionEye can be installed on any Linux distribution by using PIP (the Python package manager). All the dependencies, including Motion and a web server, will be automatically added to the system.

I’ll start with the prerequisites (hardware and software), and then I’ll give you all the commands to install it on your Raspberry Pi in a few minutes.

If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.

Prerequisites to run MotionEye on Raspberry Pi

MotionEye can be used in many ways, but here are my recommendations to get started properly with it on Raspberry Pi.

Hardware requirements

  • Any Raspberry Pi model: I’m testing this on my Raspberry Pi 4, but it doesn’t really matter. The services are light enough to run on any model and they are all supported.
    A Raspberry Pi Zero 2W could be a good fit if you plan to plug a camera directly into it (small and discreet but powerful enough).
  • SD card or USB stick for the system: we’ll use Raspberry Pi OS, so both are supported. I tested with my standard SanDisk USB key.
    You may need an additional drive if you plan to record the camera flow, or add movement detection later on (this would be my go-to drive for this, same as your Pi with tons of disk space).
  • Keyboard and mouse (optional): I’m using my new favorite Rii keyboard for all my projects now. But you can use a headless setup and follow this tutorial from your computer if you prefer.

A camera module is optional. You can use motion eye in two main ways:

  • As the control center just for the web interface. You’ll connect it to various IP cameras, or another Raspberry Pi (running Motion or MotionEye themselves if needed).
  • As a standalone security camera, with only one device. In this case, you’ll need a camera module on the same Pi as MotionEye.

I recommend using the official camera module for this (or the NoIR alternative). They are perfectly supported by Raspberry Pi OS and MotionEye, so it would be the easiest way.

Operating system

MotionEye relies on Python, so it should work on any operating system as soon as you have Python 3 available (and installed).

If you can, go with Raspberry Pi OS. I tested with two versions and I can confirm it’s working, so you’ll avoid any potential issues due to the operating system. But you’re welcome to test with something else if you already have another OS running.

If you do the installation for a dedicated project, the lite version of Raspberry Pi is enough, you don’t need a desktop environment. I discovered while doing these tests for you that, even on RPI OS Lite, you get a preview of the camera picture on your screen when you test it with libcamera-still (so even for debug purposes there’s no need to install a desktop environment).

If you plan to plug a camera into this system, I would recommend using the Legacy version of Raspberry Pi OS. The new OS version came with many changes in its camera management, and I had some issues making it work on the latest version.

If you need some guidance to install Raspberry Pi OS, you can click on this link to follow my tutorial. Get your system set up with network access and move on.

Note: There is a MotionEyeOS image available somewhere, but it hasn’t been updated for several years. I’m not using it because it’s probably safer to start with Raspberry Pi OS and install the application on it “manually”.

Optional: Camera installation

MotionEye can connect to any kind of camera, local camera (USB, camera module, …), or any model on your network (or even remote cameras). Once the interface is installed, you can add as many cameras as you want.

But if you plan to use a Raspberry Pi camera module on it, please do the installation and tests before going further. There’s no point in following all the steps for MotionEye if the camera doesn’t work already.

I have a dedicated tutorial on this website on how to install a camera module on Raspberry Pi. Read it for more details.

MotionEye installation guide

Here are the main steps to install MotionEye on your Raspberry Pi:

  • Make sure your system is up-to-date.
  • Install all Python dependencies and the PIP package manager.
  • Use PIP to download and install MotionEye from the GitHub project.

Let’s see all these steps in detail now.

Update your system

As always, it’s good practice to update your system before starting any package installation for a new project. You can do this with two commands:
sudo apt update
sudo apt upgrade -y

You can type them directly on the Raspberry Pi, or do it like me, and use SSH to do everything from the comfort of your computer (here is my SSH guide if you need help to set this up).

Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.

Install MotionEye dependencies

We can then move on and install the required dependencies for MotionEye:
sudo apt install python3-dev libcurl4-openssl-dev libssl-dev

On Raspberry Pi OS, Python 3 is preinstalled (on all versions), so it should be pretty quick. But if you use another distribution, there will probably be way more packages to install at this stage.

We also need PIP (Python package manager), so make sure it’s installed by using this command:
sudo apt install python3-pip

Note: When testing with Raspberry Pi OS Buster (Legacy), I got some errors during the MotionEye installation that got fixed by doing this first:
sudo python3 -m pip install -U pip
I didn’t need that on Bullseye, but if you experience any issues you can do it, it’s safe (for information, the error I got was “Command “python setup.py egg_info” failed with error code 1″).

Install MotionEye

Now that the dependencies are installed, we can use the main commands to install MotionEye. We’ll download the archive from their GitHub project directly. So feel free to click on the link if you want to take a look first.

Anyway, here’s the command to install it with PIP:
sudo pip3 install 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'

Once done, we can run the MotionEye initialization script, which will add all the requirements (including Motion, MariaDB, a web server, etc.):
sudo motioneye_init

I only tested on a brand-new Raspberry Pi OS setup, so I can’t tell you how well it’s integrated if you already have some of these services running. I guess it will ask for your MySQL password at some point, but I don’t know. Maybe it’s safer to do a backup first in this case.

Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.

Getting started with MotionEye

Once MotionEye is installed, it’s ready to use. The web interface starts automatically, so you can directly use it to add new cameras to your system. Here are a few tips to get started.

Web access and configuration

The MotionEye interface is accessible via a web browser, on the Raspberry Pi IP address with the port 8765: http://<YOUR-IP>:8765.

If you don’t know the Raspberry Pi IP address, you can use one of the ways listed here to find it quickly. If you have a desktop environment, http://localhost:8765 should work too.

The default page of MotionEye gives you a login form. The default credentials are:

  • Login: Admin
  • Password: (empty)

Click on “Login” to access the full interface.

Start the service

MotionEye and Motion services are set to start automatically after the installation, so you shouldn’t have to worry about them.

If needed, you can handle them with your favorite service management command. I generally use service for this:
sudo service <service_name> status | start | restart | stop
But “systemctl” should work too.

So, for example:
sudo service motioneye status

Adding your camera

Once connected to the web interface, you’ll be invited to add your camera to it.

From there, the next steps will be completely different depending on your project. If you only want to add the camera module from the Raspberry Pi, choose “Local MMAL Camera” and pick the one suggested in the camera list:

If everything works as expected, you should get an interface looking like this:

You have a preview of your camera on the right side, and many options on the left. You can add as many cameras as you like by clicking on the dropdown list (Camera1) and then “Add new camera…”.

As mentioned earlier, MotionEye supports the Pi camera module (works best on Buster), but you can add any remote camera to the same page, and view all your security cameras from one page.

From there, I’ll let you play with all the options and check the official wiki for specific questions.

To push your project a bit further, I would probably add a VPN server on the Raspberry Pi, so you can access the MotionEye page from anywhere. In this case, just don’t forget to set a strong password (Admin without a password is not a good idea ^^).

Additional Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.

VIP Community
If you just want to hang out with me and other Raspberry Pi fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.

Need help building something with Python?
Create, understand, and improve any Python script for your Raspberry Pi.
Learn the essentials step-by-step without losing time understanding useless concepts.
Get the e-book now.

You can also find all my recommendations for tools and hardware on this page.

How to Install MotionEye on Raspberry Pi (Video Surveillance)

MotionEye is a powerful open-source video surveillance system that runs on Raspberry Pi. It is a great way to keep an eye on your home or office, and it can be used for a variety of purposes. In this tutorial, we will show you how to install MotionEye on Raspberry Pi.

Step 1: Install Raspbian OS

The first step is to install the Raspbian operating system on your Raspberry Pi. You can download the latest version of Raspbian from the official Raspberry Pi website. Once you have downloaded the image, you can use a tool like Etcher to write the image to your SD card.

Step 2: Install MotionEye

Once you have installed Raspbian, you can install MotionEye. To do this, open a terminal window and enter the following command:

sudo apt-get install motioneye

This will install the MotionEye software on your Raspberry Pi. Once the installation is complete, you can start the MotionEye service by entering the following command:

sudo service motioneye start

Step 3: Configure MotionEye

Once the MotionEye service is running, you can access the web interface by entering the IP address of your Raspberry Pi in a web browser. The default username and password are both “admin”. Once you have logged in, you can configure the settings for your video surveillance system.

Step 4: Add Cameras

Once you have configured the settings, you can add cameras to your system. To do this, click on the “Add Camera” button and select the type of camera you want to add. You can then enter the settings for the camera and click “Save”.

Step 5: View Live Feed

Once you have added the cameras, you can view the live feed from the cameras by clicking on the “Live View” button. You can also view recorded footage by clicking on the “Recorded” button.

Conclusion

MotionEye is a powerful open-source video surveillance system that runs on Raspberry Pi. In this tutorial, we have shown you how to install MotionEye on Raspberry Pi and how to configure it for video surveillance. We have also shown you how to add cameras and view the live feed from the cameras.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
San Vito Al Tagliamento 33078
Pordenone Italy
Item added to cart.
0 items - 0.00
Open chat
Scan the code
Hello 👋
Can we help you?