To get started, copy the existing `env-example` file to `.env` inside the `installation` directory. By default, the file will contain the following variables:
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. version-12, v11.1.15, v11)
-`MYSQL_ROOT_PASSWORD=admin`
- Bootstraps a MariaDB container with this value set as the root password. If a managed MariaDB instance is to be used, there is no need to set the password here.
-`MARIADB_HOST=mariadb`
- Sets the hostname to `mariadb`. This is required if the database is managed with the containerized MariaDB instance.
- In case of a separately managed database setup, set the value to the database's hostname/IP/domain.
-`SITES=site1.domain.com,site2.domain.com`
- List of sites that are part of the deployment "bench". Each site is separated by a comma(,).
- If LetsEncrypt is being setup, make sure that the DNS for all the site domains are pointing to the current instance.
-`LETSENCRYPT_EMAIL=your.email@your.domain.com`
- Email for LetsEncrypt expiry notification. This is only required if you are setting up the nginx proxy companion.
- Wait for the mariadb service to start before trying to create a new site.
- If new site creation fails, retry after the mariadb container is up and running.
- If you're using a managed database instance, make sure that the database is running before setting up a new site.
- Use `.env` file or environment variables instead of passing secrets as command arguments.
```sh
# Create ERPNext site
docker exec -it \
-e "SITE_NAME=$SITE_NAME" \
-e "DB_ROOT_USER=$DB_ROOT_USER" \
-e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \
-e "ADMIN_PASSWORD=$ADMIN_PASSWORD" \
-e "INSTALL_ERPNEXT=1" \
<project-name>_erpnext-python_1 docker-entrypoint.sh new
```
Environment Variables needed:
-`SITE_NAME`: name of the new site to create.
-`DB_ROOT_USER`: MariaDB Root user. The user that can create databases.
-`MYSQL_ROOT_PASSWORD`: In case of mariadb docker container use the one set in `MYSQL_ROOT_PASSWORD` in previous steps. In case of managed database use appropriate password.
-`ADMIN_PASSWORD`: set the administrator password for new site.
-`INSTALL_ERPNEXT=1`: available only in erpnext-worker and erpnext containers. Installs ERPNext on this new site.
-`FORCE=1`: is optional variable which force installs the same site.
#### Backup Sites
Environment Variables
-`SITES` is list of sites separated by (:) colon to migrate. e.g. `SITES=site1.domain.com` or `SITES=site1.domain.com:site2.domain.com` By default all sites in bench will be backed up.
-`WITH_FILES` if set to 1, it will backup user uploaded files for the sites.