> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

[localhost link]: http://localhost:3000/docs/4/app-studio/reference/app-deployment/overview

[mintlify link]: https://doc.lucidworks.com/docs/4/app-studio/reference/app-deployment/overview.md

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1205.md

This article describes general app deployment with App Studio.

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Fusion Webapps service

**Deploying App Studio** gives you an embedded instance of App Studio in each of your Fusion instances.

> [accordion] Deploy App Studio
>
> This article describes how to deploy [App Studio in Fusion 5](https://doc.lucidworks.com/docs/5/fusion/dev-portal/appkit/concepts/app-studio-enterprise/overview.md) or [App Studio in Fusion 4](https://doc.lucidworks.com/docs/4/app-studio/concepts/app-studio-enterprise/overview.md).
>
> > [!TIP]
> >
> > Starting in Fusion 5.11.0, Fusion has deprecated the Webapps service. As of Fusion 5.11.0, you should instead deploy App Studio manually.
>
> > [!TIP]
> >
> > In Fusion 4.x, the default `FUSION_PORT` value is `8764`. In Fusion 5.x, the default value is `6764`.
>
> 1. Create UI (create a new App Studio project)
>
>    ```json theme={"dark"}
>    curl -v -u USERNAME:PASSWORD -H 'Content-type: application/json' -X POST 'https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/webapps' -d '{"id": "UI_ID","name": "UI_NAME","contextPath": "/UI_CONTEXT"}'
>
>    ```
> 2. Execute the `command ./app-studio package` to generate the `app-studio-enterprise.war` file. The file is created in the following location:
>    `/<$Application>/dist/app-studio-enterprise.war`
> 3. Deploy WAR (upload to webapps service)
>
>    ```json theme={"dark"}
>    curl -v -u USERNAME:PASSWORD -X PUT -H 'Content-type: application/zip' 'https://FUSION_HOST:FUSION_PORT/api/apps/APP_NAME/webapps/UI_ID/war' --data-binary @app-studio-enterprise.war
>    ```
> 4. Go to `https://FUSION_HOST:FUSION_PORT/webapps/UI_CONTEXT/`.

## Standalone deployments

* **Deploy an App in a Servlet Container**\
  Package your search app in a Java WAR file, which can be deployed in a servlet container such as Tomcat or Jetty. This is the most common way to deploy a search app.

  > [accordion] Deploy an App in a Servlet Container
  >
  > The most common way to deploy an App Studio search application is to package it as a standard Java `.war` file, which can be deployed in any standard servlet container such as Tomcat or Jetty.
  >
  > ## Create a WAR file
  >
  > Create a WAR file suitable for deployment in a servlet container. Do either of the following:
  >
  > * [**Use a script**](https://doc.lucidworks.com/docs/4/app-studio/reference/app-deployment/building-from-source.md#package-the-web-application) - Run the script `app-studio` (on Unix or MacOS) or `app-studio.bat` (on Windows) with the parameter `package` to create the WAR file.
  > * **Download the WAR file from Fusion** - If you created the search interface in Fusion, you can download the WAR file from Fusion.
  >
  > ## Deploy the WAR file
  >
  > Deploy the WAR file in the servlet container. Follow the instructions in the documentation for the servlet container.
* **Deploy a Standalone App**

  * Package your search app in a Java JAR file that also contains an embedded Tomcat web server. The app is ready to deploy in a production environment. It is not necessary to build a WAR file and deploy that in a servlet container or application server.
  * Package your search app in a Java JAR file. You can run the app with the Java launcher.

  > [accordion] Deploy a Standalone App
  >
  > There are two ways to deploy a standalone App Studio search interface:
  >
  > * [Create an app with an embedded Tomcat web server](#embedded-tomcat-web-server)\
  >   This deployment type has an embedded Tomcat web server and is ready to deploy in a production environment. Previously, this was referred to as a "self-contained deployment."
  > * [Create an executable Java JAR file](#executable-java-jar-file)
  >   This is a JAR package. Previously, this was referred to as a "self-executing deployment."
  >
  > ## Embedded Tomcat web server
  >
  > Package your app as a standalone app for deployment to a production server. The standalone app embeds an Apache Tomcat servlet container.
  >
  > **Unix or MacOS:**
  >
  > ```bash theme={"dark"}
  > ./app-studio dist
  > ```
  >
  > **Windows:**
  >
  > ```bash theme={"dark"}
  > app-studio.bat dist
  > ```
  >
  > ### Standalone app directory
  >
  > **Unix or MacOS:**
  >
  > The standalone app for deployment is in the `_app-name_/search-app-standalone` directory.
  >
  > ```bash theme={"dark"}
  > search-app-standalone/
  >     README.md
  >     app/
  >     build/
  >     config/
  >     keystore.jks
  >     lib
  >     search-app-start.bat
  >     search-app-stop.bat
  >     search-app-stop.ps1
  >     search-app.sh
  > ```
  >
  > **Windows:**
  >
  > The standalone app for deployment is in the `_app-name_\search-app-standalone` directory.
  >
  > ```bash theme={"dark"}
  > search-app-standalone\
  >     README.md
  >     app\
  >     build\
  >     config\
  >     keystore.jks
  >     lib
  >     search-app-start.bat
  >     search-app-stop.bat
  >     search-app-stop.ps1
  >     search-app.sh
  > ```
  >
  > The `search-app-project.zip` is a snapshot of your project at the time you compiled the application.
  >
  > ## Executable Java JAR file
  >
  > In this deployment type, your search interface runs within the Java runtime environment (JRE).
  >
  > A downloaded project comes with an `app-studio` script that creates a JAR file.
  >
  > **How to create the JAR file**
  >
  > 1. In a shell window, switch to your project directory:
  >
  >    ```bash theme={"dark"}
  >    cd /path/to/project-directory
  >    ```
  > 2. Create the JAR file:
  >
  >    **Unix and MacOS:**
  >
  >    ```bash theme={"dark"}
  >    ./app-studio package
  >    ```
  >
  >    **Windows:**
  >
  >    ```bash theme={"dark"}
  >    app-studio.bat package
  >    ```
  >
  > The script creates the executable JAR file in the `dist` directory of your project:
  >
  > ```bash theme={"dark"}
  > search-app-latest.x.jar
  > ```
  >
  > ## Running an executable JAR file
  >
  > ```bash theme={"dark"}
  > java -jar search-app-latest.x.jar
  > ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.