--- title: "Docker" description: "OpnForm can be easily set up using Docker. We provide pre-built images on Docker Hub, which is the recommended method for most users." --- import CloudVersion from "/snippets/cloud-version.mdx"; ## Prerequisites - Docker - Docker Compose ## Quick Start 1. Clone the repository: ```bash git clone https://github.com/JhumanJ/OpnForm.git cd OpnForm ``` 2. Set up environment files: ```bash ./scripts/setup-env.sh --docker ``` 3. (Optional) Customize the environment variables: You can modify two environment files to customize your OpnForm installation: - The `.env` file in the `api` directory for backend configuration - The `.env` file in the `client` directory for frontend configuration For more information on available environment variables, please refer to our [Environment Variables](/configuration/environment-variables) page. 4. Start the application: ```bash docker compose up -d ``` 5. Access OpnForm at http://localhost ### Initial Login After installation, use these credentials to access the app: - Email: `admin@opnform.com` - Password: `password` You will be prompted to change your email and password after your first login. Public registration is disabled in the self-hosted version. Use the admin account to invite additional users. ## Docker Images OpnForm provides pre-built Docker images for easy deployment. You can find our official Docker images on Docker Hub: - [OpnForm API Image](https://hub.docker.com/r/jhumanj/opnform-api) - [OpnForm Client Image](https://hub.docker.com/r/jhumanj/opnform-client) We recommend using these official images for your OpnForm deployment. ## Building Your Own Docker Images By default, OpnForm uses pre-built images from Docker Hub. However, if you want to build the images yourself (for development or customization), you have two options: ### Option 1: Using Docker Compose (Recommended) The simplest way to build the images is using Docker Compose: ```bash docker compose build ``` This will build all the necessary images. You can then start the application as usual: ```bash docker compose up -d ``` ### Option 2: Building Images Manually You can also build the images manually using the provided Dockerfiles: 1. Build the API image: ```bash docker build -t opnform-api:local -f docker/Dockerfile.api . ``` 2. Build the UI image: ```bash docker build -t opnform-ui:local -f docker/Dockerfile.client . ``` If you build the images manually, make sure to update your docker-compose.override.yml to use these local images (see below). ### Overriding Docker Compose Configuration You can override the default Docker Compose configuration by creating a `docker-compose.override.yml` file. This allows you to customize various aspects of the deployment without modifying the main `docker-compose.yml` file. Example `docker-compose.override.yml`: ```yaml services: api: image: opnform-api:local ui: image: opnform-ui:local api-worker: image: opnform-api:local ``` ### Clearing all resources To completely remove all Docker containers, networks, and volumes created by Docker Compose and also remove all images used by these services, you can use the following command: ``` docker compose down -v --rmi all ```