install.sh parameters and installing in the terminal
All installer parameters, setup without a browser, a custom installation directory, the micatorctl command and a new owner password.
The install.sh installer runs on the server with sudo. Without parameters, it prepares the server and prints a link to the first-run wizard — this path is described on the Installation page. Parameters are needed to set up the tracker in the terminal, choose a different directory or set the wizard IP manually.
General rules
- Parameters are written after the file name:
sudo bash install.sh --path /opt/micator-2. - A parameter that takes a value must be followed by one. Otherwise the installer responds “No value for …” («Нет значения для …»).
- For an unknown parameter, the installer responds “Unknown parameter: …” («Неизвестный параметр: …») and does nothing.
- Any of the
--headless,--panel,--track,--email,--admin-email,--owner-password-file,--restore-envparameters switches to installation in the terminal. The wizard is not started in that case. - When you run the installer again, pass the same parameters as the first time.
Parameter table
| Parameter | Value | What it does |
|---|---|---|
--headless | none | Setup in the terminal instead of the wizard. The installer asks for the domains, email and login itself |
--panel | domain | Panel domain, for example panel.example.com |
--track | domain | Traffic domain for campaign links and postbacks, for example track.example.com. In the wizard this is the Tracking domain («Домен трекинга») field. Must differ from the panel domain |
--email | Address for HTTPS certificates: Latin letters, digits, the characters _ . + - and a mandatory @, up to 200 characters | |
--admin-email | login | Owner login. Not necessarily an email: Latin letters, digits and the characters _ . + @ -, up to 200 characters |
--owner-password-file | file | Owner password for installation without a terminal. The file is owned by root with 0600 permissions and contains one line with the password. The installer reads it once and does not delete it. See Installation without prompts |
--path | directory | Installation directory of the form /opt/name. Default: /opt/micator. See Different installation directory |
--setup-ip | IPv4 | The address the wizard opens at. By default the installer determines it itself |
--restore-env | file | The .env.production file from a backup: the new installation gets the previous server keys. See Restoring on a new server |
--verify-only | none | Downloads the release, checks the signature and contents, installs nothing. Root permissions are not needed, including on a server with the tracker installed. Release 0.1.0-beta.20261012.1 and earlier are checked on such a server only with sudo. See Checking a release without installing |
--update-controller | none | Updates only the installation service on a running tracker. See Updating the installation service (controller) |
--bundle | address or file | Where to get the release: an https://… address or a file on the server. Default: the address recorded in install.sh |
--signature | address or file | Release signature. Default: the release address or file name with the .sig suffix |
--public-key | file | Public key for checking the signature. Default: the key recorded in install.sh. Not used with --update-controller: the signature is checked with the key pinned to the installation |
--help, -h | none | Prints brief help on the parameters |
Domains are given without https://, port and path; internationalized names are in punycode. Over the network, the release is downloaded only over HTTPS: for any other protocol, the installer responds “Downloads are allowed only over HTTPS.” («Загрузка разрешена только по HTTPS.»)
Installing in the terminal
You will need a server and two domains, as for a regular installation — see Server requirements and preparation. The DNS records of both domains must point to the server IP before you start.
- Download the installer with the first command.
- Run it with the
--headlessparameter with the second command. - Answer four questions: Panel domain («Домен панели»), Traffic domain («Домен трафика»), Email for HTTPS certificates («Email для HTTPS-сертификатов»), Owner login («Логин владельца»).
- Come up with an owner password and enter it twice: at the prompts Panel owner password (at least 12 characters) («Пароль владельца панели (не менее 12 символов)») and Repeat password («Повторите пароль»). The characters are not shown on the screen.
- Wait for the line “Done. Panel: https://panel.example.com” («Готово. Панель: https://panel.example.com»).
curl -fsSLo install.sh https://install.micator.com/install.sh
sudo bash install.sh --headlessThe password is at least 12 characters and at most 72 bytes: that is 72 Latin characters or 36 Cyrillic ones. The installer asks for it after checking the domains in DNS, before the installation starts. If the password does not fit the rules or the repeat does not match, the installer prints the reason and asks again; after the third failure it stops. The password is not written to disk and is not shown: only its hash reaches the server. Write the password down yourself, for example in a password manager.
To avoid prompts for the domains and login, pass all four values as parameters. The --headless parameter is then not needed:
sudo bash install.sh --panel panel.example.com --track track.example.com --email [email protected] --admin-email adminIf only some of the values are given, the installer asks for the rest in the terminal. It asks for the owner password in any case unless the password is passed in a file — see Installation without prompts.
As it works, the installer prints: “Downloading the signed release…” («Загружаю подписанный выпуск…»), “Preparing Docker…” («Подготавливаю Docker…»), “Downloading prebuilt images…” («Загружаю готовые образы…»), “Starting the databases, panel and tracker…” («Запускаю базы, панель и трекер…»). At the end, four lines:
Готово. Панель: https://panel.example.com
Логин владельца: admin; пароль — тот, что вы задали. Он не сохраняется на сервере и не показывается.
Новый пароль владельцу: sudo micatorctl owner-password
Проверка установки: sudo micatorctl checkIn English: “Done. Panel: https://panel.example.com”, “Owner login: admin; the password is the one you set. It is not stored on the server and is not shown.”, “New owner password: sudo micatorctl owner-password” and “Installation check: sudo micatorctl check”.
If the installation stopped with an error, fix the cause and repeat the same command with the same values. The installer saves the accepted domains, email and login and does not ask for them again. If the error happened earlier — for example, the domain does not resolve in DNS yet — the questions will be asked again.
On a repeat, the owner password is asked for again only if the previous attempt stopped before the settings were written — for example, while downloading images. If the settings are already written, the password is not needed. The --owner-password-file file is not read in that case, and the installer prints “The owner password is already set in the started installation; the file is not read.” («Пароль владельца уже задан в начатой установке; файл не читается.»)
Installation without prompts
Without a terminal — for example, from a script or over ssh without -t — the installer cannot ask for the password. It stops before the installation starts: “No terminal to enter the owner password. Run the installation in a terminal or pass --owner-password-file FILE (owned by root, permissions 0600, one line with the password).” («Нет терминала для ввода пароля владельца. Запустите установку в терминале или передайте --owner-password-file ФАЙЛ (владелец root, права 0600, одна строка с паролем).»)
For such an installation, pass the password in a file:
- Create a file accessible only to root and write the password into it as one line — the first two commands below.
- Run the installer with all four values and the
--owner-password-fileparameter — the third command. - After the line “Done. Panel: …” («Готово. Панель: …»), delete the file — the fourth command.
sudo install -m 600 /dev/null /root/owner-password
sudo nano /root/owner-password
sudo bash install.sh --panel panel.example.com --track track.example.com --email [email protected] --admin-email admin --owner-password-file /root/owner-password
sudo rm /root/owner-passwordThe installer reads the file once and does not delete it; it reminds you of this with the line “The owner password was read from /root/owner-password. This file is not deleted: delete it yourself when you no longer need it.” («Пароль владельца прочитан из /root/owner-password. Этот файл не удаляется: удалите его сами, когда он больше не нужен.»)
File requirements:
- a regular file, not a symbolic link;
- owned by root with
0600permissions: the file is closed to the group and other users; - one line with the password; a trailing newline is allowed;
- the file is not empty and is no larger than 4 KiB.
The password is not passed as a command parameter, only in a file.
Differences from the wizard
| What | Wizard in the browser | Installation in the terminal |
|---|---|---|
| Owner password | You set it yourself in the wizard form | You set it yourself: the installer asks for it twice or reads it from the --owner-password-file file. With --restore-env, the password is not taken from the backup |
| Team name and logo | Set on step 2 | Not set. The panel keeps the Micator wordmark. With --restore-env, they are taken from the backup file |
| License key | Entered on step 2 | Entered in the panel after the first login |
| Domain check | Before issuing certificates, the wizard checks that the domains point to this server | Before installation, only the presence of the domains in DNS is checked. HTTPS is checked at the end |
| Restore from a backup | The Restore from a backup («Восстановить из резервной копии») block | The --restore-env parameter, then data restore in the panel |
In both cases, the owner password is not stored on the server and is not shown. There is no file with the password.
After installation, log in to the panel:
- Open
https://panel.example.com/login. - Enter the owner's Login («Логин») and the password you set during installation.
- Click Log in («Войти»).
If the “Tracker access closed” («Доступ к трекеру закрыт») screen opens, enter the key in the License key («Ключ лицензии») field and click Activate («Активировать») — see Getting a key and activation.
Different installation directory
By default, the tracker is installed in /opt/micator. The --path parameter sets a different directory:
sudo bash install.sh --path /opt/micator-2- The directory must look like
/opt/name. The name may contain Latin letters, digits,_and-. - The directory must be empty or not exist. The installer creates it itself. A symbolic link is not accepted.
- The parameter works with both the wizard and installation in the terminal.
- The
setup-access.txtfile and the other installation files are in this directory. Databases and uploaded pages are stored in Docker volumes, not in it. - When you run the installer again and with
--update-controller, pass the same--path. - The installer finds an installation made before this release in the
/opt/trackerdirectory by itself: without--path, it works with that installation, not with/opt/micator. If there are installations in both directories, it stops with the message “Several installations found. Specify --path explicitly.” («Найдено несколько установок. Укажите --path явно.») - The parameter does not add a second installation to the same server: the installer finds the existing one and stops.
You do not need to give the directory to the micatorctl command: it remembers it during installation.
Setting the wizard IP manually
The wizard opens at the server's public IPv4. The installer looks for this address on the server's network interfaces. If there is no public address on them, the installer stops: “Could not determine the public IPv4. Pass --setup-ip with the server IP.” («Не удалось определить публичный IPv4. Передайте --setup-ip IP сервера.»)
sudo bash install.sh --setup-ip 203.0.113.10- Only a public IPv4 is accepted. For a private address or IPv6, the installer shows the same message.
- The wizard responds only at this address and at the panel domain.
- The address is fixed when the wizard is prepared. Once the wizard link has appeared, running again with a different
--setup-ipdoes not change it. - With installation in the terminal, the parameter is not used.
The micatorctl command
The installer puts the micatorctl command on the server. With a wizard installation, it appears after the server is prepared; with a terminal installation, after the tracker has started and passed the readiness check.
Earlier releases installed this command under the name trackerctl. On such servers it stays and works the same way, and micatorctl appears next to it after updating the installation service. While the server has only trackerctl, the command's messages name it.
| Command | What it prints |
|---|---|
sudo micatorctl status | “Version: …; phase: …” («Версия: …; этап: …») |
sudo micatorctl check | The same, and it checks readiness once. Success — “Services and HTTPS are responding.” («Сервисы и HTTPS отвечают.») If something is not ready — “Not ready: …” («Не готовы: …») with the name of what did not respond |
sudo micatorctl owner-password | Sets a new owner password. Success — “Owner password … changed. Their open panel sessions are ended; API tokens were not changed.” («Пароль владельца … изменён. Его открытые сессии в панели завершены; API-токены не менялись.») See New owner password |
Run check after the tracker has started. The check runs on the server itself and does not show whether ports 80 and 443 are open from outside. If the previous run of the installer in the terminal ended with an error, both commands print “The last attempt was interrupted at this phase.” («Последняя попытка прервалась на этом этапе.») after the version line. The responses are explained in the Where to see the installation state section.
Phase values
| Phase | What it means |
|---|---|
awaiting_setup | The server is prepared; the wizard is waiting for setup in the browser |
starting | Settings are saved; the databases, panel and tracker are starting |
ready | The tracker is installed and has passed the readiness check |
With a terminal installation, the command appears only after the readiness check, so it shows ready.
Intermediate phases in the install-state.json file
The phase is written to the install-state.json file in the installation directory. Before the micatorctl command appears, it can contain these values:
preparing— the installer is preparing the server for the wizard;new,files,images,isolation— terminal installation steps: settings accepted, files being copied, images being downloaded, PHP network restrictions, the geo database and the installation service being configured.
New owner password
The tracker stores only the hash of the owner password, so the old password cannot be recovered — you can only set a new one. In the panel, another owner does this; see Editing a user and resetting a password. Nobody sets the password of the installation owner in the Team («Команда») section: the installation owner changes it themselves in the My profile («Мой профиль») window, with the current password. If the password is forgotten or nobody can log in, root sets a new password on the server:
- Connect to the server over SSH.
- Run the command below.
- Enter the new password twice: at the prompts New owner password (at least 12 characters) («Новый пароль владельца (не менее 12 символов)») and Repeat password. The characters are not shown on the screen.
- Wait for the line “Owner password admin changed. Their open panel sessions are ended; API tokens were not changed.” («Пароль владельца admin изменён. Его открытые сессии в панели завершены; API-токены не менялись.»)
sudo micatorctl owner-passwordThe password requirements are the same as during installation: at least 12 characters, at most 72 bytes.
- Without parameters, the password of the installation owner is changed — the account with the login set during installation. If the owner login was changed in the panel or you need another owner, give the login:
sudo micatorctl owner-password --email LOGIN. - Without a terminal, for example over
sshwithout-t, the password is passed in a file:--password-file FILE. The file requirements are the same as during installation. The command does not accept installer parameters such as--admin-emailand--owner-password-file. - All open panel sessions of this owner are ended, and they need to log in with the new password. Sessions of other users and API tokens do not change; tokens are revoked in the panel, see API tokens.
- If login was locked after many failed attempts, the new password works immediately. The panel is not restarted, and traffic is not interrupted. The login rate limit per IP remains — see Login attempt limits.
- The change is recorded in the Audit log: context
micatorctl, actionowner_password, userroot (micatorctl). The record does not contain the password. If the server has only the oldertrackerctlcommand, the record hastrackerctlandroot (trackerctl).
The command works only on an installed tracker. Until the wizard or the installer has finished, the password is set in them.
Installations of earlier releases
Earlier releases wrote the owner password to the server: to the owner-access.txt file in the installation directory and to .env.production. After updating the tracker, change the installation owner's password with this command — before updating the installation service, it is called sudo trackerctl owner-password. The command deletes these records and writes what was deleted, for example “Deleted /opt/tracker/owner-access.txt with the old password.” («Удалён /opt/tracker/owner-access.txt с прежним паролем.») If the wizard of an earlier release restored the tracker from a backup, the command also deletes the backup downloaded to the server in .setup/restore; the backup stays in the storage. When you change the password of another owner, these records are not touched.
Command messages
| Message | Cause | What to do |
|---|---|---|
| “Run the command as root: sudo micatorctl owner-password.” («Команду запускают от root: sudo micatorctl owner-password.») | The command was run without sudo | Repeat with sudo |
| “No terminal to enter the new owner password. …” («Нет терминала для ввода нового пароля владельца. …») | There is no interactive terminal, for example with ssh without -t | Connect with ssh -t or pass --password-file |
| “Owner with login … not found; specify --email. Owners: …” («Владелец с логином … не найден; укажите --email. Владельцы: …») | The installation owner's login was changed in the panel, or --email names someone who is not an owner | Repeat with --email and a login from the list |
| “Password: at least 12 characters, at most 72 bytes, no line breaks.” («Пароль: минимум 12 символов, максимум 72 байта, без переноса строк.») | The password is shorter than 12 characters or longer than 72 bytes, or the file has several lines | Set a different password. In the terminal, the command asks for it again; after the third failure it stops |
| “Passwords do not match.” («Пароли не совпадают.») | The password repeat did not match three times | Run the command again |
| “Installation is not finished yet: the owner password is set during installation.” («Установка ещё не завершена: пароль владельца задаётся при установке.») | The wizard or the installer is still running | Set the password in the wizard or the installer |
| “Wait for the update to finish.” («Дождитесь окончания обновления.») | An update from the panel is in progress | Repeat after the update |
| “Another operation is already running.” («Другая операция уже выполняется.») | The installer or the installation service is working with this directory | Wait for it to finish and repeat |
| “Password not changed: the panel did not respond. Check: sudo micatorctl check” («Пароль не изменён: панель не ответила. Проверьте: sudo micatorctl check») | The admin panel container is not running or did not respond | Run sudo micatorctl check and fix the cause |
| “No connection to the panel database” («Нет соединения с базой панели») | The PostgreSQL database is not responding | Run sudo micatorctl check and fix the cause |
| “Password not changed: the panel database is unavailable” («Пароль не изменён: база панели недоступна») | The PostgreSQL database stopped responding during the password change | Run sudo micatorctl check, fix the cause and repeat the command |
| “sudo micatorctl owner-password does not accept …” («sudo micatorctl owner-password не принимает …») | An installer parameter was given | The login is passed with --email, the file with --password-file |
Messages about the password file are the same as during installation; see the table below.
If something went wrong
| Message in the terminal | Cause | What to do |
|---|---|---|
| “No terminal: pass the domains, email and login as parameters.” («Нет терминала: передайте домены, email и логин параметрами.») | The installer was run without an interactive terminal and cannot ask questions | Pass --panel, --track, --email and --admin-email |
| “No terminal to enter the owner password. …” («Нет терминала для ввода пароля владельца. …») | The installer was run without an interactive terminal and cannot ask for the password | Run the installation in a terminal or pass --owner-password-file; see Installation without prompts |
| “Could not read the owner password file.” («Не удалось прочитать файл с паролем владельца.») | There is no file at the given path, or the path leads to a symbolic link | Give the path to a regular file |
| “The owner password file must be owned by root and have 0600 permissions.” («Файл с паролем владельца должен принадлежать root и иметь права 0600.») | The file owner is not root, the file is open to the group or others, or it is not a regular file | Run sudo chown root:root FILE and sudo chmod 600 FILE |
| “The owner password file is empty or larger than 4 KiB: it must contain one line with the password.” («Файл с паролем владельца пуст или больше 4 КиБ: в нём должна быть одна строка с паролем.») | The file is empty or too large | Write one line with the password into the file |
| “Password: at least 12 characters, at most 72 bytes, no line breaks.” («Пароль: минимум 12 символов, максимум 72 байта, без переноса строк.») | The password is shorter than 12 characters or longer than 72 bytes, or the file has several lines | Set a different password. In the terminal, the installer asks for it again; after the third failure it stops |
| “Passwords do not match.” («Пароли не совпадают.») | The password repeat did not match three times | Repeat the command |
| “Could not prepare the owner password. Try again.” («Не удалось подготовить пароль владельца. Повторите попытку.») | The installer could not get the password hash: to compute it, the panel image from the release is run | Repeat the command. If the message repeats, check Docker: sudo systemctl status docker |
| “Not filled in: …” («Не заполнено: …») | An empty answer was given to a question | Repeat the command and enter a value |
| “The panel and traffic need different domains.” («Для панели и трафика нужны разные домены.») | The same domain was given | Give two different domains |
| “A domain without protocol, port or path is required; internationalized names in punycode.” («Нужен домен без протокола, порта и пути; международные имена — в punycode.») | The domain contains https://, a port, a path or invalid characters | Enter only the name, for example panel.example.com |
| “A domain is required, not an IP address.” («Нужен домен, а не IP-адрес.») | An IP was given instead of a domain | Give a domain |
| “Invalid value: email.” («Недопустимое значение: email.») or “Invalid value: login.” («Недопустимое значение: логин.») | The value contains a space or an invalid character, or it is longer than 200 characters | Use Latin letters, digits and the characters _ . + @ - |
| “Specify an email for the certificates.” («Укажите email для сертификатов.») | The email has no @ sign | Give an address like [email protected] |
| “The domain does not resolve in DNS yet: …” («Домен ещё не разрешается в DNS: …») | The domain has no DNS record, or the record has not updated yet | Add an A record pointing to the server IP, wait and repeat the command |
| “The installation path must look like /opt/name without spaces.” («Путь установки должен иметь вид /opt/имя без пробелов.») or “The installation path must look like /opt/name.” («Путь установки должен иметь вид /opt/имя.») | --path names a directory of a different form | Give a path like /opt/micator |
| “Several installations found. Specify --path explicitly.” («Найдено несколько установок. Укажите --path явно.») | The command was run without --path, and there are installations in both /opt/micator and /opt/tracker | Give the directory of the right installation in --path |
| “The rerun parameters differ from the started installation.” («Параметры повторного запуска отличаются от начатой установки.») | The domains, email or login were changed on the repeat | Repeat with the previous values or only with --headless: the installer takes the saved ones |
| “Installation was started in the terminal. Continue with the same command.” («Начата установка через терминал. Продолжите прежнюю команду.») | The repeat was run without terminal installation parameters | Repeat the previous command or run with --headless |
The “Not ready: …” message at the end of the installation is covered in the Services not ready section, and the others on the Installation errors and how to fix them page. Where the files are and which services are created is on the Installation files, ports, services and logs page.