Get Started

Download

It is recommended to install a fresh Ubuntu 18.04 for the Operating System before beginning. If you have other applications installed on the server machine you will need to ensure there are no conflicts.

If you have questions please post on Reddit or Discord. Due to limited resources support time is limited. Ordering a support package will give you priority for support.

Moe Alam
Download

Requirements (for installing from Source)

  • MariaDB 10.1.30+ (or equivalent)
  • Node.js 8 or 9
    • check your version with nodejs -v or node -v
  • FFMPEG 3.2.4 or higher with libvpx and libx264.
  • Linux or MacOS base operating system capable of running the previously mentioned libraries and programs.
    • Virtual Machines use Linux.
    • Currently Windows cannot natively run Shinobi. This is due to the choice of certain exec commands and not the JavaScript itself. You can adapt it for use on Windows but it will take one with a sharp mind and a bold heart.

Installation

The Easiest Way (Portable)

Warning : Currently this executable does not run as a service.

The easiest way to run is to use the Portable method. The following operating systems are supported.

  • Ubuntu 17.10.1 and 18.04

  • CentOS 7

  • MacOS 10.7(+)

The Ninja Way

Warning : The Ninja Way installs from source code. Which means many libraries from other sources are going to be installed aswell.

The easiest way to install from source, directly on metal, is through git. The following operating systems are supported.

  • Ubuntu 17.10.1 and 18.04

  • CentOS 7

  • MacOS 10.7(+)

  1. Become root to use the installer and run Shinobi. Use one of the following to do so.

    • Ubuntu 17.10.1 and 18.04

      sudo su
    • CentOS 7

      su
    • MacOS 10.7(+)

      su
  2. Download and run the installer.

    bash <(curl -s https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-install.sh)

Docker

Docker is not recommended because they create extra layers of processing, and usually issues that shouldn't be dealt with by an end-user. You should install Shinobi on its own machine, directly on the Operating System. Try the Ninja Way with Ubuntu 18.04 Server.
  1. Just do it.

     docker run -d --name=Shinobi -e APP_BRANCH=dev -p 8080:8080/tcp -v "/dev/shm/shinobiStreams":/dev/shm/streams:rw -v "$HOME/shinobiConfig":/config:rw -v "$HOME/shinobiCustomAutoLoad":/customAutoLoad:rw -v "$HOME/shinobiDatabase":/var/lib/mysql:rw -v "$HOME/shinobiVideos":/opt/shinobi/videos:rw shinobisystems/shinobi:latest-ubuntu

Ubuntu : The Easier Way

This installer works well with Ubuntu 17.10.1

  1. Open Terminal.

  2. Become root.

    sudo su
  3. Install git command line library.

    apt install git -y
  4. Pull the repository.

    git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
  5. Open Shinobi directory.

    cd Shinobi
  6. Start the installer

    chmod +x INSTALL/ubuntu.sh && INSTALL/ubuntu.sh
  7. Packages will be installed. MariaDB will ask to create a password on first installation.

  8. Once complete. Open up http://localhost:8080 in your browser.

    • Note : if you are installed on a remote computer open up the IP in your web browser.

  9. Login at http://your.shinobi.video/super.

    Username : [email protected]
    Password : admin
  10. You should now be able to manage accounts

  11. To Update Shinobi :

    Update Shinobi via Terminal

CentOS, Fedora, RHEL : The Easier Way

This installer works well with CentOS 7.

  1. Open Terminal.

  2. Download and Install Node.js, NPM.

    sudo yum update
    sudo yum install curl -y
    curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
    sudo yum install nodejs npm -y
  3. Install git command line library.

    yum install git -y
  4. Pull the master repository.

    git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
  5. Open Shinobi directory.

    cd Shinobi
  6. Start the installer

    chmod +x INSTALL/centos.sh && INSTALL/centos.sh
  7. Packages will be installed. MariaDB will ask to create a password on first installation.

  8. Once complete. Open up http://localhost:8080 in your browser.

    • Note : if you are installed on a remote computer open up the IP in your web browser.

  9. Login at http://your.shinobi.video/super.

    Username : [email protected]
    Password : admin
  10. You should now be able to manage accounts

  11. To Update Shinobi :

    Update Shinobi via Terminal

Windows : The Hard Way

You should use WSL on Windows 10 instead (Easier) of installing directly on Windows, If you wish to install directly on Windows continue reading.

Warning for Native Installs : Shinobi is running on a process manager, PM2, which sometimes opens command windows for other tasks. Choosing not to use PM2 avoids this command window issue, see below on different start methods.

Please create a Ram Disk or use an SD card for your temporary files. To avoid this you can install Ubuntu Desktop instead. Ubuntu comes with a temporary directory for you to use by default so it is not necessary to set one for it.

You will need a few things installed before being able to run Shinobi.

Install Node.js, MariaDB and your favorite SQL client. The links are posted above.

  1. Once all those are installed download and extract Shinobi and place where you want it to run from.

    Example C:/Shinobi
  2. Open HeidiSQL (or your SQL client) and log in to the MariaDB server now running on your system. The credentials are the ones you put in during the installation of MariaDB.

  3. Open the Query tab on HeidiSQL. Then open your Shinobi directory and locate the folder labeled sql. Drag the following files to your query tab and click the Run button to import the database.

    • framework.sql

    • user.sql

  4. Open the ffmpeg zip you downloaded. Find the folder labelled bin. Copy this folder into your Shinobi directory and rename it to ffmpeg.

    Example C:/Shinobi/ffmpeg
  5. Make a copy of conf.sample.json and rename it to conf.json.

    Set your windowsTempDir inside your conf.json. You must do this on Windows or you may end up with very bad performance and possibly shortening the life of your hardware at the same time.

    It is recommended that you use ImDisk or a SD Card as the temporary directory.

    More information about conf.json file can be found here.

    "windowsTempDir":"R:/Temp"
  6. Open Command Prompt. Click the Start Menu on your Windows taskbar and begin typing cmd.exe. Open the Shinobi directory.

    cd C:/Shinobi
  7. Install the Shinobi libraries.

    npm install pm2 -g
    npm install
  8. Run Shinobi one of two ways.

    • With Process Manager (you can close the initial command windows after starting with automatic restart if process crashes)

      pm2 start camera.js
      pm2 start cron.js
    • The regular way (you must keep the command window open after starting shinobi, no other command windows should be visible.)

      1. node camera.js
      2. Open a new Command prompt window and start the cron script.

        node cron.js

Account Management

Set up Superuser Access

Rename super.sample.json to super.json. Run the following command inside the Shinobi directory with terminal. Passwords are saved as MD5 strings. You only need to do this step once.

cp super.sample.json super.json

Login at http://your.shinobi.video/super.

Username : [email protected]
Password : admin

You should now be able to manage accounts

Set up Sub-Accounts

Login at http://your.shinobi.video/admin. With the main account of the group. If a sub account is used to login to this page it will be directed to the regular dashboard.

Clean up

Set up the cron file

  1. Run cron.js to get data about how much space is used and to clear old videos.

    pm2 start cron.js
    

Updating Shinobi

Getting the latest files

There were multiple ways to do this, now there is only one recommended way to do it. Please follow the link below.

Daemonize and Startup

Keep running and on boot

  1. Start camera.js and cron.js then run check to see they are running under PM2.

    pm2 start camera.js
    pm2 start cron.js
    pm2 list
  2. After camera.js and cron.js are started you can run the following to start them on boot.

    pm2 startup
    pm2 save

Configuration

Default Login

Login at http://your.shinobi.video/super.

Username : [email protected]
Password : admin

You should now be able to manage accounts

Configuration File

conf.json

conf.json is the file that you create from conf.sample.json during the install process using the following command from inside the Shinobi directory.

cp conf.sample.json conf.json

Anyway! on to what’s really important. What’s in the file itself. This is the contents of conf.sample.json.

{
    "port": 8080,
    "addStorage": [
        {"name":"second","path":"__DIR__/videos2"}
    ],
    "ssl":{
       "key":"/path/to/key/file",
       "cert":"/path/to/cert/file"
    },
    "db": {
        "host": "127.0.0.1",
        "user": "majesticflame",
        "password": "",
        "database": "ccio",
        "port":3306
    },
    "mail":{
        "service": "gmail",
        "auth": {
            "user": "[email protected]",
            "pass": "your_password_or_app_specific_password"
        }
    },
    "cron":{
        "key":"change_this_to_something_very_random__just_anything_other_than_this"
    },
    "pluginKeys":{
        "Motion":"change_this_to_something_very_random____make_sure_to_match__/plugins/motion/conf.json"
    }
}

Available Options for conf.json

Options Required Type Description
cpuUsageMarker no string The marker that is used to search for CPU usage in top command. Default is %Cpu. Some systems, like Puppy Linux, require it be set to CPU.
defaultMjpeg no string A path leading to a JPEG file. This default image is needed for when the camera cannot provide frames.
doSnapshot no boolean By default the snapshot in the top left open its own FFMPEG process for a moment to get a single frame, You can avoid this by turning on JPEG API or setting this option to false.
updateKey no string For updating by API.
streamDir no string default is /dev/shm/streams/. Remember to end with /. Leave it undefined or null to use default. Be careful in using HLS as Stream Type. This directory should be set as somewhere in RAM
videosDir no string default is videos/ in the Shinobi directory. Remember to end with /. Leave it undefined or null to use default.
windowsTempDir no string default is C:/Windows/Temp. If your system is not located on the C: drive then you must add this option in your conf.json file.
DropboxAppKey no string Future releases will hide dropbox functions when this key is left null.
ip no string IP that is used for the Shinobi server instance. Default is undefined, which will tell the webserver to automatically choose.
port yes int Port that is used for the Shinobi server instance. Default is 8080
utcOffset yes string Timezone that matches your SQL database.
db yes object The login information for the SQL database
db.host yes string The IP address or domain name. Default is 127.0.0.1
db.user yes string The user name. Default is majesticflame.
db.password yes string The password. Default is no password.
db.database yes string The database name. Default is ccio.
db.port yes int The port number for Shinobi. Default is 3306.
cron no object The object that contains some options for cron.js
cron.deleteOld no boolean cron will delete videos older than Max Number of Days per account. Default is true.
cron.deleteNoVideo no boolean cron will delete SQL rows that it thinks have no video files. Default is true.
cron.deleteOverMax no boolean cron will delete files that are over the set maximum storage per account. Default is true.
mail no object If your Email account uses 2-Step Authentication, like Gmail, then you will be require to create an Application Password.
ssl no object If you would to use SSL (Encryption) you can include this object.
ssl.key yes* string Required if SSL object is present. This is a reference to a file that usually ends in .key.
Example : ssl/server.key will direct to a folder named ssl inside your Shinobi directory.
ssl.cert yes* string Required if SSL object is present. This is a reference to a file that usually ends in .crt.
Example : ssl/server.crt will direct to a folder named ssl inside your Shinobi directory.
ssl.passphrase yes* string If your key and certificate use a passphrase you must define it or SSL will not start.
ssl.port no int This is the port SSL will listen on. If option is undefined 443 will be used.
language no string Default is en_CA. You can check the langauges folder inside the Shinobi directory for more options. You can make more by using node tools/translateLanguageFile.js.
addStorage no object View the sample above for how to structure this object.
passwordType no string This can be sha256, sha512, or md5. md5 is the default.
passwordSalt yes* string This is only needed if passwordType is set to sha512.

Troubleshooting

Finding Problems

What to do

For all errors please try the following before posting in the Issues or asking on Discord.

Posting in the Issues

The following are required when posting in the issues.

  • Must be about Shinobi, not Node.js or a library used by Shinobi
  • Include a snippet of any errors you are describing.
    • If logs are not available, providing some screenshots may be helpful.
  • Must be about a bug.

Support Packages


We will answer your questions about how Shinobi works, the different ways you can use it, and it's documentation. We will keep your installation maintained with the latest stable build.

Ordering a support package also supports the developers.