In addition to the automation APIs and billing system modules, Installatron includes a number of human-friendly command-line interfaces that automate the process of installing new applications and managing existing installed applications.
If JSON output is preferred to human-friendly output, append this to any command:
--api=json
This effectively makes all output the same as the HTTP-API.
If JSON input is preferred to key-value pairs, /usr/local/installatron/installatron will accept JSON input. For example:
echo '{ "cmd":"install", "application":"wordpress", "user":"ws124", "url":"http://company.com/blog", }' | /usr/local/installatron/installatron
Command:
./installatron --browser ./installatron --browser --application magento
NAME | VALUE |
--cmd | browser |
--application | optional The ID of the application to list available versions of. This can be a single application or an array of multiple applications. By default the latest version of each application is listed. Listed versions are ordered correctly. |
--version | optional If application is set to one application, set this to only list the specific version. |
--from-version | optional If application is set to one application, set this to list all versions from specified version to the latest version. Each listed version includes a "upgrade_from" member which reveals whether an install at the specified version can upgraded to the listed version (values of "none" or "manual" mean it cannot). Listed versions are ordered correctly. |
--versions-available-from | optional If application is set to one application, instead of the usual output this will return two lists, "versions-available" and "versions-available-minor", each listing the versions upgradable to from the specified value. |
--language | optional The language application information should be returned in. For example, "en" for English or "zh_tw" for Chinese Traditional. If omitted, the defined website's default language or English is assumed. See: Available Installatron Translations. |
Note: When the install is complete, the new install owner will be emailed install login information.
Command:
./installatron --install
NAME | VALUE |
--cmd | install |
--application | required The ID of the application to be installed. For example, "wordpress" or "magento". Use the browser API to get a list of available applications. |
--version | optional, default is the latest compatible version The version of the application to be installed. |
--autoup | optional Change automatic update configuration. Values: 0 = Off (default); 1 = Update to minor versions only; 2 = Update to any version. |
--autoup-backup | optional Automatically create a backup and automatically restore the backup if the update fails. Values: 0 = Off; 1 = On (default). |
--url | required The URL to where the application should be installed. |
--url-ip | optional, default is the IP address resolved via DNS If the DNS will not resolve the provided url to the correct IP, use this argument to provide the correct IP. |
--db-host | optional, if omitted a new database is automatically created The database server. |
--db-name | optional, if omitted a new database is automatically created The pre-created database. |
--db-user | optional, if omitted a new database is automatically created The pre-created database username. |
--db-pass | optional, if omitted a new database is automatically created The pre-created database password. |
--db-prefix | optional, defaults to the prefix behavior configured at Installatron Admin > Features The prefix applied to database tables. |
--db-host-ip | optional, typically omitted If a different MySQL host value must be temporarily used to connect to the database, use this argument to provide the temporary address. Installed application files will be written with the "db_host" value, but Installatron will use "db_host_ip" while installing. |
--notification | optional List of email notifications to send for the installed application (each separated with a comma). Set a value of "all" to send all notifications (limited by those that are enabled in administration » Emails), or define an empty string to send no notifications.Available notifications:
A sample value could look like: "update_available,update,update_error" |
--background | optional When defined, the request will exit immediately and the task will be transferred to a background process after preliminary error checking. Use the tasks API to query the status of the background task. |
--dryrun | optional When defined, the request payload is validated but not executed. Dryrun set to a value of 2 checks everything, and dryrun set to a value of 1 just checks input so it can return faster. |
Optional automatic backup arguments:
NAME | VALUE |
--autobk | optional Change automatic backup configuration. Values: custom = A custom schedule; (id) = The schedule identified by (id). |
--autobk-daily | optional The number of daily backups (for the "custom" option) |
--autobk-weekly | optional The number of weekly backups (for the "custom" option) |
--autobk-monthly | optional The number of monthly backups (for the "custom" option) |
Optional remote backup arguments:
NAME | VALUE | ||||||||||||||||||||||||||||||
--bkloc | optional Set this to the URI to a backup location (which will be associated with the defined "user" for the session).Supported protocols:
Examples:
|
Further optional arguments that depend on the application (get a full list of fields available for a specific application/version using the browser API):
NAME | VALUE |
--language | optional, default is the website's default language or English The language of the application to be installed. For example, "en" for English or "zh_tw" for Chinese Traditional. Use the browser API to get a list of available languages for the installed application. |
--login | optional, default is randomly generated value The username for the installed application's administrative account. |
--passwd | optional, default is randomly generated value The password for the installed application's administrative account. If omitted, a randomized password is assumed. |
--sitetitle | optional, default is "My blog" or similar The site title value for the installed application. |
--content | optional, default is "yes" Set to "yes" for the sample/demo template.Set to "no" for the blank install template. Set to the ID of the template for a different template. |
Command:
./installatron --import
NAME | VALUE |
--cmd | import |
--user | required/optional Import the application to a specific user on the control panel. This field is required if the import command is performed as the server administrator or a reseller but is optional if performed as a user. |
--application | required The ID of the application to be imported or migrated. For example, "wordpress" or "magento". See: List of applications. |
--version | optional, defaults to the automatically-detected version The version of the application to be imported. If omitted, the version is automatically detected. |
--url | required For a local Import this is the URL to where the application is current located. For a remote Import (a Migration) this is the destination URL where the copy of the source application will be constructed. |
--url-ip | optional, default is the IP address resolved via DNS If DNS cannot resolve the provided url to the correct IP, use this argument to provide the correct IP. |
--source-url | required if migrating an installed application from a remote server If migrating an installed application from a remote server, include this argument to provide the source installed application URL.For example, "http://website.com/wordpress". |
--source-ftu | required if migrating an installed application from a remote server If migrating an installed application from a remote server, include this argument to provide the source installed application account information.Supported filesystem protocols:
Specifically for WordPress only, Installatron Server also provides the option to migrate an installation using only the WordPress administrative username and password. No filesystem protocol is required in this case, just the WordPress administrative username and password. To use this option, provide the username and password in this format: app://username:password Examples:
|
--source-ftu-key | optional, path to a SSH key file If migrating an installed application from a remote server over SSH or SFTP, the SSH/SFTP password can be left blank and an optional SSH key file can be defined here. |
--source-url-ip | optional, default is the IP address resolved via DNS If migrating an installed application from a remote server, include this argument to provide Installatron the IP address that Installatron should use for the source server. Providing this value means that Installatron will not need to perform DNS lookup on the source domain. |
--background | optional When defined, the request will exit immediately and the task will be transferred to a background process after preliminary error checking. Use the tasks API to query the status of the background task. |
--dryrun | optional When defined, the request payload is validated but not executed. Dryrun set to a value of 2 checks everything, and dryrun set to a value of 1 just checks input so it can return faster. |
Command:
./installatron --installs
NAME | VALUE |
--cmd | installs |
--user | optional View the installs of a specific user on the control panel. The default is the control panel administrator. |
--q | optional Search installed application with a query. This searches the title, url, id, installer, and owner fields. |
--id | optional Display a specific installed application by ID. |
--filter-version-available | optional When set equal to "yes", only installed applications that have any new version upgrades available will be listed. |
--filter-version-available-minor | optional When set equal to "yes", only installed applications that have new minor version upgrades available will be listed. |
--filter-ownedaccounts | optional Add this parameter (as; filter-ownedaccounts=) if you wish to also see the installs of accounts owned by this user. |
Command:
./installatron --backups
NAME | VALUE |
--cmd | backups |
--user | optional View the backups of a specific user on the control panel. The default is the control panel administrator. |
--q | optional Search installed application backups with a query. This searches the title, url, id, installer, and owner fields. |
--pid | optional Display only installed application backups that belong to this installed application ID. This can be used in conjunction with the "q" argument. (added with version 4.1.5) |
--id | optional Display a specific installed application backup by ID. |
--filter-ownedaccounts | optional Add this parameter (as; filter-ownedaccounts=) if you wish to also see the backups of accounts owned by this user. |
Command:
./installatron --view
NAME | VALUE |
--cmd | view |
--id | required The ID of the installed application to be synced and displayed. |
--addons | optional Set to a value of 1 to include a list of installed plugins and themes in the result. (WordPress only) |
Note: Optional arguments can be omitted if they should remain unchanged.
Command:
./installatron --edit
NAME | VALUE |
--cmd | edit |
--id | required The ID of the installed application to be edited. |
--url | optional, defaults to the existing value The URL to the installed application. |
--autoup | optional, defaults to the existing value Change automatic update configuration. Values: 0 = Off; 1 = Update to minor versions only; 2 = Update to any version. |
--autoup-backup | optional, defaults to the existing value Automatically create a backup and automatically restore the backup if the update fails. Values: 0 = Off; 1 = On (default). |
--notification | optional, defaults to the existing value List of email notifications to send for the installed application (each separated with a comma). Omit this argument to retain the current value, set a value of "all" to send all notifications (limited by those that are enabled in administration » Emails), or define an empty string to send no notifications.Available notifications:
A sample value could look like: "update_available,update,update_error" |
--db-host | optional, defaults to the existing value The server that hosts the installed application's database. |
--db-name | optional, defaults to the existing value The name of the installed application's database. |
--db-user | optional, defaults to the existing value The database username used to connect to the installed application's database. |
--db-pass | optional, defaults to the existing value The database username password. |
--db-prefix | optional, defaults to the existing value The prefix each database table begins with, including trailing underscore (if any). |
Automatic backup arguments:
NAME | VALUE |
--autobk | optional, defaults to the existing value Change automatic backup configuration. Values: custom = A custom schedule; (id) = The schedule identified by (id). |
--autobk-daily | optional, defaults to the existing value The number of daily backups (for the "custom" option) |
--autobk-weekly | optional, defaults to the existing value The number of weekly backups (for the "custom" option) |
--autobk-monthly | optional, defaults to the existing value The number of monthly backups (for the "custom" option) |
Remote backup arguments:
NAME | VALUE | ||||||||||||||||||||||||||||||
--bkloc | optional, defaults to the existing value Set this to the URI to a backup location (which will be associated with the defined "user" for the session).Supported protocols:
Examples:
|
Further arguments that depend on the application (get a full list of fields available for a specific application/version using the browser API):
NAME | VALUE |
--language | optional, defaults to the existing value The language of the installed application. Use the browser API to get a list of available languages for the installed application. |
--login | optional, defaults to the existing value The username of the installed application's administrative account. |
--passwd | optional, defaults to the existing value The password of the installed application's administrative account. |
optional, defaults to the existing value The email of the installed application's administrative account. | |
--sitetitle | optional, defaults to the existing value The site title value of the installed application. |
Remove any backups connected to this installed application from the database:
NAME | VALUE |
--delete-backups | optional, defaults to null Set to 'true' to delete any backups connected to the installed application from the Installatron database. The backup archives will be unaffected. |
Remove the installed application from the database:
NAME | VALUE |
--delete | optional, defaults to null Set to 'true' to delete the installed application from the Installatron database only. The installed application files and tables will be unaffected. |
Command:
./installatron --backup
NAME | VALUE |
--cmd | backup |
--id | required The ID of the installed application to be backed up. |
--expiry | optional, defaults to never Possible values include:
|
--background | optional When defined, the request will exit and the task will be transferred to a background process. Use the tasks API to query the status of the background task.Possible values include:
|
Command:
./installatron --clone
NAME | VALUE |
--cmd | clone |
--id | required The ID of the installed application to be cloned. |
--url | required The URL where the application should be cloned to. |
--url-ip | optional, default is the IP address resolved via DNS If the DNS will not resolve the provided url to the correct IP, use this argument to provide the correct IP. |
--db-host | optional, if omitted a new database is automatically created The database server. |
--db-name | optional, if omitted a new database is automatically created The pre-created database. |
--db-user | optional, if omitted a new database is automatically created The pre-created database username. |
--db-pass | optional, if omitted a new database is automatically created The pre-created database password. |
--db-prefix | optional If a database prefix other than the default prefix should be used, specify the value here. |
--background | optional When defined, the request will exit immediately and the task will be transferred to a background process after preliminary error checking. Use the tasks API to query the status of the background task. |
--dryrun | optional When defined, the request payload is validated but not executed. Dryrun set to a value of 2 checks everything, and dryrun set to a value of 1 just checks input so it can return faster. |
Note: It's always recommended to create a backup prior to updating any installed application.
Command:
./installatron --upgrade
NAME | VALUE |
--cmd | upgrade |
--id | required The ID of the installed application to be updated. |
--version | optional, default is the latest compatible version The version to be updated to. Use the browser API to get a list of available versions.Note: A value of 'current' can be used to skip updating (if only plugins and themes). |
--revert | optional, default is "no" If set to 'yes', a backup will be created prior to attempting the upgrade, and the backup will automatically be restored if the upgrade fails. |
--plugin | optional If set to '*' or a comma-separated list of plugin ID's, all plugins or the listed plugins will be updated to their current version (WordPress only). Use the view API to get a list of installed plugins. |
--theme | optional If set to '*' or a comma-separated list of theme ID's, all themes or the listed themes will be updated to their current version (WordPress only). Use the view API to get a list of installed themes. |
--background | optional When defined, the request will exit and the task will be transferred to a background process. Use the tasks API to query the status of the background task.Possible values include:
|
--dryrun | optional When defined, the request payload is validated but not executed. Dryrun set to a value of 2 checks everything, and dryrun set to a value of 1 just checks input so it can return faster. |
Example 1: Upgrade specified installed applications on the server to the most recent version.
/usr/local/installatron/installatron --upgrade --id='519d6fe412b34ce4757f251381cf8a99+c4ca4238a0b923820dcc509a6f75849b'
Example 2: Upgrade all installed applications on the server to the most recent version, creating a backup for each install and reverting to the backup on failure.
/usr/local/installatron/installatron --upgrade --id='*' --revert
Command:
./installatron --restore
NAME | VALUE |
--cmd | restore |
--id | required The ID of the installed application backup to be restored. |
--db | optional Set to 'manual' to skip creating the database when it doesn't exist. Setting this to 'manual' is recommended if the database is always created prior to calling this API. |
--background | optional When defined, the request will exit immediately and the task will be transferred to a background process after preliminary error checking. Use the tasks API to query the status of the background task. |
--dryrun | optional When defined, the request payload is validated but not executed. Dryrun set to a value of 2 checks everything, and dryrun set to a value of 1 just checks input so it can return faster. |
If the backup should be restored to a location different than the original location:
NAME | VALUE |
--url | required The URL where the backup should be restored to. |
--url-ip | optional, default is the IP address resolved via DNS If the DNS will not resolve the provided url to the correct IP, use this argument to provide the correct IP. |
--db-host | optional, if omitted a new database is automatically created The database server. |
--db-name | optional, if omitted a new database is automatically created The pre-created database. |
--db-user | optional, if omitted a new database is automatically created The pre-created database username. |
--db-pass | optional, if omitted a new database is automatically created The pre-created database password. |
--db-prefix | optional If a database prefix other than the default prefix should be used, specify the value here. |
Command:
./installatron --uninstall
NAME | VALUE |
--cmd | uninstall |
--id | required The ID of the installed application to be uninstalled. |
--force | optional, default is disabled Include this argument to force the uninstall even if there are connection errors. |
--background | optional When defined, the request will exit and the task will be transferred to a background process. Use the tasks API to query the status of the background task.Possible values include:
|
Command:
./installatron --delete
NAME | VALUE |
--cmd | delete |
--id | required The ID of the installed application backup to be deleted. |
--force | optional, default is disabled Include this argument to force the deletion even if there are connection errors. |
--background | optional When defined, the request will exit and the task will be transferred to a background process. Use the tasks API to query the status of the background task.Possible values include:
|
Command:
./installatron --importbackup
NAME | VALUE |
--cmd | importbackup |
--user | required The user to import the backup for. |
--path | required The path to the installed application backup archive to be imported, relative to the path defined for the user specified. |
Command:
./installatron --tasks
NAME | VALUE |
--cmd | tasks |
Sample JSON return value:
{ "result": true, "message": "The task is complete.\n", "data": [ { "id": "138207901722178300", "user": "dev1", "ws_label": "dev1", "url": "http://dev1.installatron.com/installdir", "title": "My blog (3)", "label": "_tasks_backuping", "status": "processing", "rate": 10150, "percentMin": 50, "percentMax": 99, "message": "_tasks_shared_copyingfiles", "cmd": "backup", "install": "4yhfygnd10ws0wc8skck444s", "time": 1382079023 } ] }