First boot and install once
This page is for bundlers of images, containers and appliances. The installers write secrets, unique keys and the recipient's addresses into the installation. A bundle should therefore ship the code ready to install and run the installation once, at the recipient's first start.
Contents
- Why not install at build time
- Why not install at every start
- The already-installed test
- A first-boot sequence
- What must not be in the bundle
Why not install at build time
An installation made on your build machine and shipped to many recipients would give every recipient:
- the same administrator password, or one your build log has seen;
- the same database credentials in
settings/siteaccess/*/site.ini.append.php; - the same e-mail preferences' site secret, which
CreateSiteswrites tosettings/override/mailpreferences.ini.append.php(4.4); - your build's URL and host names instead of theirs.
The exception is a public demo that is rebuilt from scratch on a schedule (Education and demo bundles).
Why not install at every start
exp:install uses --db-action=remove by default, which empties the database first. An entry point that installs
at every start destroys the site at every restart. "In a container, run the install once (for example when
settings/override/site.ini.append.php has no [DatabaseSettings]), not at every start"
(6.11).
The already-installed test
grep -q '^\[DatabaseSettings\]' settings/override/site.ini.append.php 2>/dev/null"The test ... is the same test exp:install itself uses to decide that a directory already holds an installation"
(4.6). It must read the
persistent copy of settings/override/: in a container that directory lives on a volume
(Container images).
A first-boot sequence
- Wait for the database (server engines only) until it accepts connections.
- Check ownership of
var/,settings/anddesign/for the site's user (File permissions and var/ ownership). - Skip the rest if already installed (the test above).
- Read secrets from the platform's secret store into
EXP_INSTALL_DB_PASSWORDand, if you set one, the administrator password. - Install as the site's user:
exp:installwith the recipient's URL and e-mail, or the kickstarter with a rendered template. - Check the exit status; on
1, keepvar/log/setup.logand stop. Maintenance mode stays on, so visitors see a 503 page, not a half-built site. - Hand over the password: show
var/log/initial-admin-passwordonce through your platform's channel (a console message, a panel page, a secure e-mail), then delete the file. - Remove install files: a rendered
kickstart.ini, temporary package copies. - Start serving (Web server and engine choices) and the cron schedule (Cron jobs).
A container entry point that does steps 3, 5 and 9 is on Container images.
What must not be in the bundle
- To do: No
settings/override/*.ini.append.phpwith database credentials, mail passwords or secrets of your build. - To do: No
settings/siteaccess/written by an installer run. - To do: No
kickstart.ini(the templateskickstart.ini-distandkickstart.ini--exampleare fine). - To do: No
var/log/initial-admin-password, no logs, no caches of your build. - To do: No SQLite database file with content, unless it is a demo bundle by design.
- To do: No
config.env.phpof your build machine; it names the machine's environment (EXP_ENV) and is kept out of version control by design (config.env.php.example). - To do: No
.gitdirectories you did not mean to ship.
Related pages
- Unattended install with exp:install
- Automating provisioning
- Security defaults of a bundle
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.