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). 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:
  • 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.
--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:

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 protocols:
ProtocolExample URINotes
FTPftp://user:pass@server/directory
FTPSftps://user:pass@server/directory
SFTPsftp://user:pass@server/directory
SSHssh://user:pass@server/directory
SSH with public keyssh://user:public-key@server/directory
WebDAVwebdav://user:pass@server/backups
WebDAV (HTTPS)webdavs://user:pass@server/backups
Dropboxdropbox2://auth-id:token@app-idOAuth only
Amazon AWS S3s3://aws-access-key:aws-secret-key@bucket-id.region-id

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
--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:
  • FTP
  • FTPS
  • SFTP
  • SSH

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:
  • ftp://user:pass@website.com
  • sftp://user:pass@website.com/public_html
  • ftp://user:pass@website.com/public_html/phpbb
  • app://user:pass (WordPress only)
--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.

Back to top▴

List installed applications

Command:

./installatron --installs

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

Back to top▴

List installed application backups

Command:

./installatron --backups

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

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 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:
  • 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 protocols:
ProtocolExample URINotes
FTPftp://user:pass@server/directory
FTPSftps://user:pass@server/directory
SFTPsftp://user:pass@server/directory
SSHssh://user:pass@server/directory
SSH with public keyssh://user:public-key@server/directory
WebDAVwebdav://user:pass@server/backups
WebDAV (HTTPS)webdavs://user:pass@server/backups
Dropboxdropbox2://auth-id:token@app-idOAuth only
Amazon AWS S3s3://aws-access-key:aws-secret-key@bucket-id.region-id

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

Clone an installed application

Command:

./installatron --clone

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

Update an installed application

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

Command:

./installatron --upgrade

NAMEVALUE
--cmdupgrade
--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:
  • 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.
--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

Restore an installed application backup

Command:

./installatron --restore

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

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

Uninstall an installed application

Command:

./installatron --uninstall

NAMEVALUE
--cmduninstall
--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:
  • 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.

Delete an installed application backup

Command:

./installatron --delete

NAMEVALUE
--cmddelete
--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:
  • 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.

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

NAMEVALUE
--cmdtasks

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
        }
    ]
}
© 2004 - 2024 Installatron LLC. All rights reserved. Privacy Policy.