# Deployment

This page covers essential steps for deploying an application to ACC. It includes configuring environment variables, adding a remote repository, creating a tag, building the application, and deploying it on ACC.

## <mark style="color:red;">Required Environment Variables​</mark> <a href="#required-environment-variables" id="required-environment-variables"></a>

Before initiating your application's deployment to ACC, it is important to set up the necessary environment variables. Please ensure you have added the following variables to your application before your first deployment:

* **NEXT\_PUBLIC\_URL**: The website's URL, accessible from the ACC dashboard.
* **NEXTAUTH\_URL**: The website's URL, identical to NEXT\_PUBLIC\_URL.
* **NEXTAUTH\_SECRET**: A secret string for session encryption, generated from any online tool.
* **CACHE\_SECRET**: A secret string for encrypting Redis cache requests. Generate this using any online tool; without it, Redis cache may not function properly.

## <mark style="color:red;">Add Remote Repository​</mark> <a href="#add-remote-repository" id="add-remote-repository"></a>

For deploying your application to ACC, the addition of a remote repository is required. Obtain the URL of the remote repository from the ACC dashboard.

Run the following command to add the remote repository:

```
git remote add acc <acc-repository-url>
```

## <mark style="color:red;">Create and Push a Tag​</mark> <a href="#create-and-push-a-tag" id="create-and-push-a-tag"></a>

For deploying your application to ACC, create a tag within your repository. Ensure all changes are committed before proceeding.

Run the following command to create a tag:

```
git tag <tag-name>
```

Then, push the tag to the remote repository:

```
git push acc <tag-name>
```

## <mark style="color:red;">Build Your Application​</mark> <a href="#build-your-application" id="build-your-application"></a>

Navigate to My Applications > {Your Application} > Builds. Click the **Build** button. Enter the tag name created in the previous step and click **Build** button.

## <mark style="color:red;">Deploy Your Application​</mark> <a href="#deploy-your-application" id="deploy-your-application"></a>

Upon successful completion of the build, initiate the deployment by providing the same tag name and clicking the **Deploy** button.
