> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/project-zero/next.js/deployment.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.akinon.com/technical-guides/project-zero/next.js/deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
