Login/Register

Command-line Interface

Introduction

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.

JSON Output

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.

JSON Input

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

Table of contents

Back to top▴

List available applications and application information

Command:

./installatron --browser
./installatron --browser --application magento

NAMEVALUE
--cmdbrowser
--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.

Back to top▴

Install an application

Note: When the install is complete, the new install owner will be emailed install login information.

Command:

./installatron --install

NAMEVALUE
--cmdinstall
--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). Omit this argument entirely to send all notifications, or define an empty string to send no notifications.

Available notifications:
  • install
  • install_error
  • clone
  • clone_error
  • backup
  • backup_error
  • restore
  • restore_error
  • update_available
  • update
  • update_error
  • plugin_update_available
  • plugin_update
  • plugin_update_error

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.

Optional automatic backup arguments:

NAMEVALUE
--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:

NAMEVALUE
--bkloc
optional
Set this to the URI to a backup location (which will be associated with the defined "user" for the session).

Supported filesystem protocols:
  • FTP
  • FTPS
  • SFTP
  • SSH
  • WebDAV (HTTP)
  • WebDAVS (HTTPS)

Examples:
  • ftp://user:pass@server
  • sftp://user:pass@server/backups
  • ftp://user:pass@server/backups
  • webdav://user:pass@server/backups

Further optional arguments that depend on the application (get a full list of fields available for a specific application/version using the browser API):

NAMEVALUE
--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.

Back to top▴

Import an existing application (from the local server or a different server)

Command:

./installatron --import

NAMEVALUE
--cmdimport
--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
The URL to where the application is 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.
--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:
  • FTP
  • FTPS
  • SFTP
  • SSH

Examples:
  • ftp://user:pass@website.com
  • sftp://user:pass@website.com/public_html
  • ftp://user:pass@website.com/public_html/wordpress

Back to top▴

List installed applications

Command:

./installatron --installs

NAMEVALUE
--cmdinstalls
--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.

Back to top▴

List installed application backups

Command:

./installatron --backups

NAMEVALUE
--cmdbackups
--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.

Back to top▴

View/sync an installed application

Command:

./installatron --view

NAMEVALUE
--cmdview
--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)

Edit an installed application

Note: Optional arguments can be omitted if they should remain unchanged.

Command:

./installatron --edit

NAMEVALUE
--cmdedit
--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 entirely to send all notifications, or define an empty string to send no notifications.

Available notifications:
  • install
  • install_error
  • clone
  • clone_error
  • backup
  • backup_error
  • restore
  • restore_error
  • update_available
  • update
  • update_error
  • plugin_update_available
  • plugin_update
  • plugin_update_error

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:

NAMEVALUE
--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:

NAMEVALUE
--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 filesystem protocols:
  • FTP
  • FTPS
  • SFTP
  • SSH
  • WebDAV (HTTP)
  • WebDAVS (HTTPS)

Examples:
  • ftp://user:pass@server
  • sftp://user:pass@server/backups
  • ftp://user:pass@server/backups
  • webdav://user:pass@server/backups

Further arguments that depend on the application (get a full list of fields available for a specific application/version using the browser API):

NAMEVALUE
--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.
--email
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:

NAMEVALUE
--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:

NAMEVALUE
--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.

Backup an installed application

Command:

./installatron --backup

NAMEVALUE
--cmdbackup
--id
required
The ID of the installed application to be backed up.
--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:
  • Any value other than "quick": The task will exit after preliminary error checking is completed to ensure there's enough disk space, etc..
  • A value of "quick": The task will exit immediately, withholding preliminary error checking until the process is executing in the background.
--expiry
optional, defaults to never
Possible values include:
  • "never": The created backup will never expire. This is the default value.
  • "auto": Automatically expire the backup based on the configured backup expiration rules (the default is 14 days)
  • Any number: The created backup will expire after the number of days identified by the provided number.

Clone an installed application

Command:

./installatron --clone

Required arguments:

Optional arguments:

Optional database arguments:

Update an installed application

Note: It's always recommended to create a backup prior to updating any installed application.

Command:

./installatron --upgrade

Required arguments:

Optional arguments:

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

Restore an installed application backup

Command:

./installatron --restore

Required arguments:

Optional arguments:

Uninstall an installed application

Command:

./installatron --uninstall

Required arguments:

Optional arguments:

Delete an installed application backup

Command:

./installatron --delete

Required arguments:

Optional arguments:

Import a backup

Command:

./installatron --importbackup

NAMEVALUE
--cmdimportbackup
--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.

List currently executing and recently completed tasks

Command:

./installatron --tasks

Optional arguments:

© 2004 - 2016 Installatron LLC. All rights reserved.