# Monit - UNIX Systems Management
Run Monit inside docker. From project [docker-monit](https://github.com/kijart/docker-monit)
[![Monit](https://mmonit.com/monit/img/logo.png)](https://mmonit.com/monit/)
[Monit](https://mmonit.com/monit/) is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.
Default username/password: `admin/monit`
## Versions
| Docker image | Monit |
| ---------------------- | --------- |
| `monit:latest` | `5.34.0` |
## Docker setup
Install docker:
Install docker compose:
Docker documentation:
### Build-in docker image
- build docker image `docker build -t monit .`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
> note: monitrc is a file! create before docker run.
### Build-in docker image arm64
- build docker image `docker buildx build --platform arm64 -t monit .`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
> note: monitrc is a file! create before docker run.
### Docker Hub image
- pull docker image from gitlab: `docker pull registry.gitlab.com/manalejandro/monit-docker/monit:latest`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc registry.gitlab.com/manalejandro/monit-docker/monit:latest`
- create a docker container:
```bash
docker create \
--name=monit \
-p 2812:2812 \
-v $(pwd)/monitrc:/etc/monitrc \
registry.gitlab.com/manalejandro/monit-docker/monit:latest
```
### Docker compose
- create a container using docker-compose: `docker-compose up --no-start`
- start monit: `docker-compose up`
### Troubleshooting
If when starting Monit returns the following message: `The control file '/etc/monitrc' permission 0755 is wrong, maximum 0700 allowed`, simply give the appropriate permissions to _monitrc_: `chmod 700 monitrc`.
If when starting Monit returns the following message: `input in flex scanner failed`, simply you need to create an empty file with name `monitrc` in your source folder will do.