Shinobi CCTV docker

Instalação e configurações Shinobi

Instalação e configurações Shinobi

Shinobi API

Link: https://docs.shinobi.video/api

RESTful API

 Simple and Efficient

Everything that the official dashboard does is through the Shinobi API. Meaning If you decide to build your own user interface or just using certain functions of Shinobi; The API will make quick work of it.

When you authenticate with Shinobi it will offer you an Authorization Token. This token is your Session Key as well and can be used as an API Key. This key will remain active for 15 minutes after the last acivity or while your WebSocket is connected.

 Let's Begin

Create an API Key or Login to get started.

After Authentication

/api/managing-api-keys-ui
/api/managing-api-keys-api
/api/api-connecting-websocket
/api/get-monitors
/api/get-events
/api/get-streams
/api/embedding-streams
/api/get-videos
/api/get-timelapse
/api/get-fileBin
/api/custom-settings
/api/add-edit-or-delete-a-monitor
/api/modifying-a-video-or-deleting-it
/api/monitor-triggers
/api/superuser-only
/api/administrator-only
/api/monitor-states-preset-configurations
/api/scheduling-for-monitors
/api/system-triggers
/api/direct-camera-management-via-onvif
Instalação e configurações Shinobi

Instalação Shinobi Docker

Link: https://gitlab.com/Shinobi-Systems/ShinobiDocker   git clone https://gitlab.com/Shinobi-Systems/ShinobiDocker.git

Install Shinobi with Docker

2024-05-07

https://shinobi.video https://docs.shinobi.video/installation/docker

Quick Install

  1. Run this in terminal.
    bash <(curl -s https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-docker.sh)

Advanced Install

  1. Download this repository and enter it.
    • If you do not have Docker installed run sh INSTALL/docker.sh.
  2. Review and modify the docker-compose.yml file.
    • Leave it as-is for default setup.
  3. Run the preparation and starter script.
    bash setup_and_run.sh

Once Installed

You will be asked if you want to use the included database, default is Yes. Once complete open port 8080 of your Docker host in a web browser.

The following tables offer a breakdown of the configurations that control how the shinobi and shinobi-sql services are set up and interact within your Docker environment. Adjustments can be made to these values directly in the associated docker-compose files to modify the behavior of the deployment as needed.

docker-compose-sql.yml : shinobi-sql 
Service Environment Variables

Variable Description Default Value
MYSQL_ROOT_PASSWORD The password for the MySQL root user. rootpassword
MYSQL_DATABASE The name of the database to create. ccio
MYSQL_USER The username for the database. majesticflame
MYSQL_PASSWORD The password for the database user. 1234


docker-compose-main.yml : shinobi 
Service Build Arguments and Environment Variables

Build Arguments

Argument Description Default Value
SHINOBI_BRANCH The branch of the Shinobi git repository to clone during the build process. dev

Environment Variables

Variable Description Default Value
HOME The home directory path within the container. /home/Shinobi
DB_HOST Hostname of the MySQL database server. shinobi-sql
DB_USER Username to connect to the MySQL database. majesticflame
DB_PASSWORD Password to connect to the MySQL database. 1234
DB_DATABASE Name of the MySQL database to use. ccio
SHINOBI_UPDATE Whether to pull updates from git when the container starts. false


Script Failing? Run this.

apt install dos2unix -y && dos2unix entrypoint.sh && chmod +x entrypoint.sh && dos2unix setup_and_run.sh && chmod +x setup_and_run.sh && bash setup_and_run.sh

Instalação e configurações Shinobi

Instalação Shinobi Docker Desktop Windows

Link: https://docs.shinobi.video/installation/docker-windows

Running Shinobi in Windows Docker Desktop

A step-by-step tutorial on how to install and run Shinobi using Docker on Windows. By following these instructions, you’ll have Shinobi up and running in a container, accessible through your web browser.

Below is a step-by-step tutorial on how to install and run Shinobi using Docker on Windows. By following these instructions, you’ll have Shinobi up and running in a container, accessible through your web browser.

Also Thanks to warbleeder in the Community Chat for putting the information together for this document to be written!


 1. Download & Install Docker for Windows

  1. Download Docker:

  2. Install Docker:

    • Run the Docker Desktop Installer you just downloaded.
    • During the installation wizard, ensure that WSL (Windows Subsystem for Linux) is checked.
    • After the installation completes, reboot your system when prompted.

 2. Initial Docker Configuration

  1. Open Docker Desktop:

    • After rebooting, launch Docker Desktop .
    • It may prompt you for an email address. You can skip this step.
    • Proceed through the next couple of setup screens until Docker finishes its initial configuration.
  2. Enable Host Networking:

    • Once Docker is running, click the Settings icon (gear icon at the top-right of the Docker Desktop window).
    • Go to Resources → Network .
    • Check the box for Enable host networking .
    • Click Apply & Restart .
    • Wait for Docker to restart; if a prompt appears to cancel or continue, click Cancel to return to the main screen.

 3. Pull the Shinobi Image

  1. Open the Built-in Terminal:

    • In Docker Desktop, look to the bottom-right corner and click the Terminal icon.
    • Click Enable to activate the integrated terminal.
  2. Pull the Shinobi Image:

    • In the terminal, copy and paste or type:
docker pull registry.gitlab.com/shinobi-systems/shinobi:dev

 4. Run the Shinobi Container

  1. Copy the Image ID:

    • Once the pull is complete, click on the Images tab in Docker Desktop.
    • Locate the Shinobi image you just downloaded.
    • Next to the image, click the copy button to copy the image’s ID (it will be in the form of a long sha256 hash).
  2. Start the Container:

    • Return to the Terminal in Docker Desktop.
    • Type the following command, replacing <Image_ID> with the ID you copied:
docker run -d -p 8080:8080 <Image_ID>
docker run -d -p 8080:8080 sha256:f3f6ed55e741e260c0b975f8d89f1358018b53ab28b9887ae00e363fd2e3423c

3. Confirm the Container is Running:


 5. Access Shinobi in Your Browser

  1. Open Shinobi Superuser Interface:

    • Launch your web browser and navigate to:
http://localhost:8080/super

2. Log In with Default Credentials:

3. Explore Shinobi:

Once logged in, you can manage and customize your Shinobi installation as needed.


 6. Troubleshooting & Support


That’s it!

You have successfully installed and launched Shinobi on Windows using Docker. You can now explore camera setup, motion detection, video recording, and all the other powerful features Shinobi has to offer. Enjoy!