Predefined installation options
Install script parameters
For automated DirectAdmin installations, it is possible to configure basic installer configuration parameters from the command line interface. By passing server-specific options like license key, hostname, and DNS name server addresses, it is possible to run an unattended DirectAdmin installation.
Basic options can be customized by exporting environment variables set to the desired values like so:
export php1_release=8.0
For PHP modules:
export php_imap=yes
Then run installation with the following command:
bash setup.sh LICENSE_KEY
If more options have to be customized, it would be better to use a pre-defined options.conf file. For example, you may pre-set the hostname:
Hostname:
If the /usr/local/directadmin/custombuild/options.conf or the /usr/local/directadmin/conf/directadmin.conf files exist, the installation process will not use defaults because it will instead use the settings from your predefined "options.conf" and/or "directadmin.conf" files. So, copy them from another server, or download from a URL where you placed the options.conf and/or directadmin.conf files prior to installation:
mkdir -p /usr/local/directadmin/custombuild
wget -O /usr/local/directadmin/custombuild/options.conf "http://yourdomain.com/options.conf"
mkdir -p /usr/local/directadmin/conf/
wget -O /usr/local/directadmin/conf/directadmin.conf "http://yourdomain.com/directadmin.conf"
A sample call for the setup.sh script with environment variables:
cd /root/
wget -O setup.sh https://download.directadmin.com/setup.sh
chmod 755 setup.sh
DA_HOSTNAME="server.yourdomain.com" bash setup.sh LICENSE_KEY
Other environment variables that could be used:
DA_CHANNEL : Download channel: alpha, current, stable
DA_COMMIT : Exact DA build to install, will use latest from update channel if empty
DA_OS_SLUG : Build targeting specific platform: linux_amd64, debian10_amd64, rhel8_amd64, ...
DA_EMAIL : Default email address
DA_HOSTNAME : Hostname to use for installation
DA_ADMIN_USER : Default admin account user name
DA_ADMIN_PASSWORD : Default admin account password
DA_ETH_DEV : Network device
DA_NS1 : pre-defined ns1
DA_NS2 : pre-defined ns2
Additional environment variables that could be set non-empty value to take effect (for example, DA_SKIP_CSF=true):
DA_SKIP_CSF : skip installation of CFS firewall
DA_WEB_INSTALL : run DirectAdmin installer in interactive web mode
DA_SKIP_MYSQL_INSTALL : skip installation of MySQL/MariaDB
DA_SKIP_SECURE_PHP : skip disabling insecure PHP functions automatically
DA_SKIP_AUTO_TLS_CERT : skip attempt to issue server hostname certificate using ACME protocol
DA_SKIP_CUSTOMBUILD : skip all the CustomBuild actions
DA_FOREGROUND_CUSTOMBUILD : run CustomBuild installation in foreground DA_SKIP_CUSTOMBUILD is unset"
And that way, when the setup.sh runs CustomBuild, it will use your settings without any changes.
The mysql_inst and mariadb/mysql versions variables are handled properly with setup.sh, so the setup.sh script can be used to compile proper database service at installation time.
Options for script installation mode
Options must be set in-place before calling the setup.sh in command-line mode.
- Configuration files
options.confanddirectadmin.confcan be set in place with desired options before runningsetup.sh. Doing so will do things like using your desired download server, using the desired php version/mode, webserver type, etc. Place the files in the following locations prior to running thesetup.sh:
/usr/local/directadmin/custombuild/options.conf
/usr/local/directadmin/conf/directadmin.conf
Ensure these files have your desired settings defined, so that when CustomBuild runs, it will use those settings instead of the defaults.
- Custom Email and ns1/ns2 can be declared by exporting the following variables with your desired email and nameservers before running
setup.sh:
export DA_EMAIL=email@example.com
export DA_NS1=ns1.example.com
export DA_NS2=ns2.example.com
- To use your desired hostname, specify it like this:
export DA_HOSTNAME="server.yourdomain.com"
- To skip mysql installation, export the following variable:
export DA_SKIP_MYSQL_INSTALL=true
Continue installation normally.
Note: If you use this option (set it before you run the setup.sh), then it will be your responsibility to ensure that the database is set up and running prior to the setup.sh being run, and that the da_admin has been set up in the mysql.conf, ready for DA to use.
- To install the pre-release version of DirectAdmin when installing for the first time, you can use the flag
alphaupdates channel.
DA_CHANNEL=alpha bash setup.sh LICENSE_KEY