Skip to main content
OpnForm uses two .env files for configuration: one for the Laravel backend located in the api directory, and one for the Nuxt front-end located in the client directory.

Public instance URL (self-hosted)

Set these variables before exposing a self-hosted instance publicly or configuring OIDC, OAuth, emails, or any feature that generates links back to your OpnForm instance. They must use the real public URL, never localhost in production. For a standard Docker deployment available at https://forms.example.com:
The setup command creates or updates the following values while preserving existing application keys and secrets: APP_URL, FRONT_URL, and NUXT_PUBLIC_APP_URL normally have the same public origin. In the standard Docker setup, the API is served through that same origin under /api, which is why NUXT_PUBLIC_API_BASE ends in /api. If your API is exposed on a separate public origin, use that browser-accessible API URL instead. If you configure these values manually, recreate the affected containers. docker compose restart does not reload environment values. See Updating Environment Variables. For the deployment workflow, see Docker Deployment. For the OIDC-specific checklist, see OIDC SSO Configuration.

Backend Environment Variables

The following environment variables are used to configure the Laravel application (OpnForm’s API).

Dedicated guides

There are dedicated configuration pages available for more detailed setup instructions on specific topics:

Configuration Environment Variables

Self-hosted Enterprise licensing

Self-hosted Enterprise features are unlocked by activating a license key in the OpnForm UI. Most installations can use the default license API endpoint. Use the LICENSE_* variables only when you need to override checkout, billing portal, or license API URLs for your deployment. For activation steps and troubleshooting, see License Activation.

OAuth Integration Environment Variables

OAuth integrations enable user authentication and third-party service connections. OpnForm automatically handles OAuth redirect URLs - you don’t need to manually configure redirect URIs in your OAuth applications.
For detailed setup instructions for each OAuth provider, see the OAuth Integration Setup guide.

User Options Environment Variables

PHP Configuration Environment Variables

These PHP configuration variables are particularly important when handling file uploads and processing large amounts of data. If any of these variables are not set, PHP will use its default values from the php.ini configuration. When using Docker, these values are set in the docker-compose.yml file. For non-Docker installations, you’ll need to configure these values in your PHP configuration (php.ini) file. For local file storage, /upload-file accepts temporary uploads up to PUBLIC_UPLOADS_MAX_FILE_SIZE (50 MB by default). If your workspace allows larger attachments, increase this value and ensure PHP and your reverse proxy accept the larger request, including multipart overhead. This setting does not change direct S3 uploads. Form assets, such as logos and cover images, retain their separate 5 MB limit.

Database Configuration Environment Variables

These variables are essential for connecting the Laravel backend to your database.

Instance Telemetry

OpnForm tracks usage of its products which helps the team to improve and deliver better software. You can opt-out of this telemetry at any time. What data is collected? The telemetry includes instance metadata and usage statistics:
  • Basic usage metrics (form creation, submissions, workspace creation, user additions)
  • Generated instance identifier (UUID), application version, and license status
  • Configured instance hostname, extracted from FRONT_URL with a fallback to APP_URL. URL paths, query parameters, ports, and credentials are excluded. Configured URLs using IP addresses or common local/internal hostnames are not reported.
  • No form content, submission data, or user emails
How is the data used? This data will only be used by OpnForm team for:
  • Directly improving the product and identifying the parts of product which are popular
  • Identifying areas with limited usage or where our users get stuck
  • Prioritizing the next set of features to be developed
  • Identifying installations when investigating usage and potential Enterprise licensing issues
The hostname can identify your installation, so instance telemetry is not anonymous. When is telemetry active?
  • Production environments (APP_ENV=production)
  • Self-hosted deployments (SELF_HOSTED=true)
  • Disabled in local/development environments
How to opt-out: Set OPNFORM_TELEMETRY_DISABLED=true in your environment variables to disable data collection, then restart the application and workers. If you cache Laravel configuration, rebuild the configuration cache as well. Existing installations using only the deprecated variable do not need to change their configuration. When migrating, replace the old variable with the new name and retain its value. If both are set, the new variable wins, including when it is explicitly false.

MCP and AI agents

MCP is disabled by default on self-hosted instances. Enable it from Settings → MCP & AI agents after configuring public HTTPS origins and Laravel Passport. Form and submission tools require OAuth. See the MCP integration guide for the complete setup.

Front-end Environment Variables

The easiest way to get started with OpnForm is through our official managed service in the Cloud. It takes just 1 minute to start building forms with the free plan, with high availability, backups, security, and maintenance all managed for you.

Docker Environment Variables

When running OpnForm with Docker, there are some important considerations for handling environment variables:
Docker Compose uses shell variables, a root .env file next to docker-compose.yml, or a file passed with --env-file when it resolves ${...} values in the Compose file. The service-level env_file entries such as ./api/.env and ./client/.env only pass variables into the containers after the Compose file has already been resolved.

Updating Environment Variables

When changing environment variables in your .env files, you need to recreate the containers for the changes to take effect. Simply restarting the containers is not sufficient as Docker only loads environment variables when containers are created. To apply new environment variable changes:
A simple docker compose restart will not reload environment variables from your .env files. You must use down and up commands to recreate the containers.