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:

List available applications and application information

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.

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.

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

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.

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

Command:

./installatron --import

NAME

VALUE

--cmd

import

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

Examples:

ftp://user:pass@website.com

sftp://user:pass@website.com/public_html

ftp://user:pass@website.com/public_html/wordpress

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

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.

Update an installed application

id: The ID of the installed application to be updated, a list of installed application ID's separated by a plus (+), or an asterisk can be specified to match all installed applications on the server.

Optional arguments:

user: If authenticated as a reseller, admin, or super-user, this argument must be set to the owner of the installed application.

version: The version to be upgraded to. If omitted, the latest, compatible version is assumed. A special value of "current" can be used to keep the current version (useful when updating plugins/themes only)

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

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

background: When defined, the request will exit immediately and the task will be transferred to a background process. Use the tasks API to query the status of the background task.

Example 1: Upgrade specified installed applications on the server to the most recent version.

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:

id: The ID of the installed application backup to be restored.

Optional arguments:

user: If authenticated as a reseller, admin, or super-user, this argument must be set to the owner of the installed application.

background: When defined, the request will exit immediately and the task will be transferred to a background process. Use the tasks API to query the status of the background task.

Uninstall an installed application

Command:

./installatron --uninstall

Required arguments:

id: The ID of the installed application to be uninstalled, a list of installed application ID's separated by a plus (+), or an asterisk can be specified to match all installed applications on the server.

Optional arguments:

user: If authenticated as a reseller, admin, or super-user, this argument must be set to the owner of the installed application.

background: When defined, the request will exit immediately and the task will be transferred to a background process. Use the tasks API to query the status of the background task.

Delete an installed application backup

Command:

./installatron --delete

Required arguments:

id: The ID of the installed application backup to be deleted, a list of installed application backup ID's separated by a plus (+), or an asterisk can be specified to match all installed application backups on the server.

Optional arguments:

user: If authenticated as a reseller, admin, or super-user, this argument must be set to the owner of the installed application backup.

background: When defined, the request will exit immediately and the task will be transferred to a background process. Use the tasks API to query the status of the background task.

Import a backup

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.

List currently executing and recently completed tasks

Command:

./installatron --tasks

Optional arguments:

user: If authenticated as a reseller, admin, or super-user, this argument must be set to the owner of the installed application backup.