Motion - Install Overview

How do I install Motion?

Motion is mainly distributed as source files that you must compile yourself. There is also an RPM made on Fedora Core 3. And Debian packages are available for selected versions.

The short overview of the steps to install Motion from sources.
  • Preparation: Motion uses a number of shared libraries that must be installed on your computer before you can build Motion. The needed shared libraries depends on the features you wish to use. Features network camera, ffmpeg, MySQL and PostgreSQL needs specific shared libraries installed. See preparation section for more information.

  • Download the motion source files (distributed as tar'ed and compressed files). Place the file in a place of your own choice.

  • Untar and uncompress the file to the place you want the program installed. Editor recommends placing the motion source file directory in /usr/local. If you do not have write access to the /usr/local directory (you are under the mercy of an ignorant system administrator with a severe case of paranoia) - you can install the program in a directory in your home directory. You will then need to read the next section about how to configure before you compile the program. Below is shown the exact commands using version 3.2.X installed in /usr/local as an example (replace /path/to and version number with the actual placement of the tar.gz file).
    cd /usr/local
    tar -xvzf /path/to/motion-3.2.X.tar.gz
  • You will now have created a directory called motion-3.2.X. You can rename it to motion (mv motion-3.1.X motion). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different version simply by changing the link.
    ln -s motion-3.2.X motion
  • Now change to the new directory.
    cd motion
  • Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
  • Build the code
  • Install the code, manual page, etc
    make install
  • In /etc/motion/etc you will find a file called motion-dist.conf. If it is the first time you install Motion - rename this file to motion.conf and edit as a minimum the settings: videodevice, input, norm, frequency, width, height and target_dir. That should get you going.
  • Run the program. To enable more features you must modify the config file.

Installation on Debian based distributions

Motion can be found in the repositories of several debian based distributions such as Ubuntu etc.

Open up a terminal window and type:

sudo apt-get install motion

The debian packages install the Motion config file in /etc/motion/motion.conf which is the correct location when Motion runs as a daeson under a system user. If you want to run Motion under your own username you need to copy the config file to our Home folder so that the master copy won’t be affected. Open a terminal and copy the configuration file to your Home folder with following commands:

mkdir .motion

(Note: This will create a hidden folder .motion in your Home directory.)

sudo cp /etc/motion/motion.conf ~/.motion/motion.conf

(Note: This command will copy the original motion configuration file to its location.)

Now can open the configuration file for editing. Change directory to the location of the motion.conf and run

sudo nano motion.conf

After you you have done so, start motion in the terminal simply by typing:

sudo motion

Topic revision: r11 - 14 Aug 2016, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.