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

# Installation

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

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

[localhost link]: http://localhost:3000/docs/5/app-studio/reference/installation/overview

[mintlify link]: https://doc.lucidworks.com/docs/5/app-studio/reference/installation/overview

This section contains various articles on the installation, system requirements, and supported environments of App Studio.

Appkit is most commonly run as a lightweight Java web application that can be deployed in any [Java Servlet Container](http://en.wikipedia.org/wiki/Java_Servlet#Container_servers) (application server) such as [Tomcat](http://tomcat.apache.org/), [GlassFish](https://javaee.github.io/glassfish/), [Jetty](http://www.eclipse.org/jetty/) depending on your preferences or IT standards. The Appkit application is designed to be [stateless](http://en.wikipedia.org/wiki/Stateless_protocol), making deployment and scaling (for example, with [load balancers](http://en.wikipedia.org/wiki/Load_balancing_\(computing\)) a straightforward exercise.

<LwTemplate />

## Requirements

App Studio is a standalone application with the following requirements:

* [Oracle Java JDK](https://www.oracle.com/technetwork/java/javase/downloads/index.html) 1.8
* A running instance of [Fusion](/docs/5/fusion/overview), with one or more collections of indexed data

## Installation

1. [Download App Studio Enterprise](/docs/5/fusion/dev-portal/appkit/concepts/app-studio-enterprise/download).
2. Copy the App Studio Enterprise zip file to any convenient path.
3. Unzip the file, and follow the instructions provided in the `README.md` file.

<Note>
  Starting in Fusion 5.0, App Studio is no longer included in the Fusion UI. However, you can use App Studio Enterprise (ASE) to create apps in Fusion 5 *and* Fusion 4. See **Deploy App Studio** for instructions.
</Note>

<Accordion title="Deploy App Studio">
  This article describes how to deploy [App Studio in Fusion 5](/docs/5/fusion/dev-portal/appkit/concepts/app-studio-enterprise/overview) or [App Studio in Fusion 4](/docs/4/app-studio/concepts/app-studio-enterprise/overview).

  <Check>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.</Check>

  <Tip>In Fusion 4.x, the default `FUSION_PORT` value is `8764`. In Fusion 5.x, the default value is `6764`.</Tip>

  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/`.
</Accordion>

### Configuring the application server

For development and testing purposes you can deploy the Appkit web application in any modern servlet container and it will run and serve queries as long as the computer has network access to the underlying search engine. This is a non-exhaustive list of servers that have been used to run Appkit applications:

* Tomcat 6+
* JBoss 8+
* Jetty 6+
* GlassFish 4+

### Java runtime environment

Appkit requires Java JDK 1.8 to be installed on the application server. Java EE is not needed.

#### Memory allocation

You must make sure that the servlet container is configured with access to an adequate amount of memory and heap space. The standard Appkit application does not have specific requirements but specific modules (for example, the [Social Module](/docs/5/fusion/dev-portal/appkit/reference/modules/collaboration/overview) have a larger footprint. See the **Troubleshooting Appkit App Builds and Deployments** for more information.

<Accordion title="Troubleshooting Appkit App Builds and Deployments">
  {/* // Update how-to header information */}

  {/* // formatted */}

  {/* // tag::intro[] */}

  Troubleshoot building and deploying Appkit apps.

  {/* // end::intro[] */}

  ## Increasing memory allocation to Jetty when running with Maven

  If you are using the Social Module with Appkit, you might have to increase the amount of memory available to the application server. When starting Appkit up with Maven set this environment variable:

  ```properties theme={"dark"}
  export MAVEN_OPTS='-Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M'
  ```

  ## Paths with encoded forward slashes not working in Tomcat

  By default, specific versions of Tomcat do not allow encoded forward slashes (%2F) in a URL. To work around this problem set this System property:

  ```properties theme={"dark"}
  -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
  ```

  This can be done either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running `$CATALINA_HOME/bin/tomcat7w.exe` (if using Tomcat 7, change as appropriate for your exact version).

  ## Problem with accented and other UTF-8 characters

  Appkit is completely stateless so all information for a Query is contained in the HTTP request. Because Tomcat by default is not configured to handle special characters (such as UTF-8) in URLs, Tomcat might be incorrectly interpreting the HTTP GET request. To correctly handle URLs, open the Tomcat server.xml file `[tomcat installation folder]/conf/server.xml`, find the \<Connector> element, and add the URIEncoding attribute to it:

  ```xml theme={"dark"}
  <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
  ```

  For more information, see the [Character Encoding FAQ](https://cwiki.apache.org/confluence/display/TOMCAT/Character+Encoding) on the Tomcat Wiki.

  If you are running Tomcat behind an HTTP server via AJP (Apache or IIS, for example), then you also must add the URIEncoding attribute to the AJP connector found in the Tomcat server.xml file:

  ```xml theme={"dark"}
  <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
  ```

  ## Error writing to Java Preference Store

  In specific cases on Linux, there is an issue with the application server being able to write temporary and other system files. In that case, start up the container with this flag:

  ```properties theme={"dark"}
  -Djava.util.prefs.userRoot=/some/writable/directory
  ```

  ## IIS authentication with Tomcat

  When using IIS as an authentication layer in front of Tomcat, the AJP connector must be told not to perform authentication in Tomcat:

  ```xml theme={"dark"}
  <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" tomcatAuthentication="false" />
  ```

  ## Long Tomcat startup times

  There is a known issue with long Tomcat startup times. To avoid this, add this entry to the JVM params, applied in `/usr/share/tomcat7/bin/catalina.sh`:

  ```properties theme={"dark"}
  JAVA_OPTS=(all your usual stuff plus:)-Djava.security.egd=file:/dev/./urandom
  ```

  ## JVM proxy settings

  You can configure your JVM to use an HTTP proxy for all outgoing network traffic by setting these system properties:

  ```properties theme={"dark"}
  -Dhttp.proxyHost=${server}
  -Dhttp.proxyPort=${port}
  -Dhttp.proxyUser=${username}
  -Dhttp.proxyPassword=${password}
  ```

  When using Tomcat, you can configure proxy settings either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running `$CATALINA_HOME/bin/tomcat7w.exe` (if using Tomcat 7, change as appropriate for your exact version).

  ## Installing Missing Image Codecs on a Windows server

  The standard SUN JDK only ships with a limited number of image codecs, which are needed for manipulating images in Appkit (for example, when resizing to generate a preview). In particular, the standard JDK lacks support for TIFF images.

  To obtain the missing codecs, we recommend installing the Java Advanced Imaging Image I/O Tools, which are available free of charge from:

  [http://download.java.net/media/jai-imageio/builds/release/1.1/INSTALL-jai\_imageio.html#Windows](http://download.java.net/media/jai-imageio/builds/release/1.1/INSTALL-jai_imageio.html#Windows)

  Down the page, you should download the JDK version of the toolkit and copy it to each delivery server that will be running Appkit:

  [http://download.java.net/media/jai-imageio/builds/release/1.1/jai\_imageio-1\_1-lib-windows-i586-jdk.exe](http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-1_1-lib-windows-i586-jdk.exe)

  Follow the installation instructions for the toolkit.

  <Note>For Windows users, the installation must be performed with a 32-bit JDK.\*</Note>

  After it has been installed, you must restart Tomcat to get the new codecs into the Java runtime. To verify which codecs are installed on the server, look for this output in Appkit.log when Tomcat starts again:

  ```log theme={"dark"}
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule - Supported image formats:
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - BMP
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - bmp
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpg
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPG
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpeg
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - wbmp
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - png
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - PNG
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPEG
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - WBMP
  2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - TIFF
  ...
  ```

  ## Missing web resources

  Under some circumstances web resources such as fonts (.ttf/.woff etc.) cannot be retrieved resulting in missing icons in the UI. In many cases this is caused by a bug in the webJAR locator library affecting some Operating Systems. Installing Tomcat on a path containing blanks causes this bug to manifest itself. The fix is simply to move Tomcat to a blank-free location (for example, on Windows in `C:\Tomcat\`).
</Accordion>

### Typical production setup

Your production setup will be a matter of preference because Appkit imposes no specific requirements in terms of topology or infrastructure. Some organisations choose to front the application server (servlet container) with either Apache or another webserver. In a public-facing scenario, this can yield some gains when serving static content and creates a buffer between the outside world and the execution environment.

### Using Windows Integrated Authentication for internal applications

If you would like to take advantage of [Integrated Windows Authentication](http://en.wikipedia.org/wiki/Integrated_Windows_Authentication) for [single sign on](http://en.wikipedia.org/wiki/Single_sign-on) in your search application, the typical pattern is to front the servlet container (for example, Tomcat) with Microsoft [Internet Information Services](http://www.iis.net/). In this pattern IIS handles the authentication with Active Directory and then forwards the request to Tomcat where it is picked up by Appkit and used by our [Security Module](/docs/5/fusion/dev-portal/appkit/reference/modules/security/authentication/overview) for user information, authorization or personalization.

## Learn more

<Accordion title="Deploying a WAR File">
  Appkit runs in most [Java servlet](http://en.wikipedia.org/wiki/Java_Servlet) containers including [Apache Tomcat](http://tomcat.apache.org/download-90.cgi), [Jetty](https://www.eclipse.org/jetty/) and [GlassFish](https://javaee.github.io/glassfish/). The majority of our customers use [Tomcat 8](http://tomcat.apache.org/download-80.cgi) for production systems.

  If using Tomcat, see the troubleshooting page for information on configuring the use of UTF-8 character encoding. (This resolves the most common issues with special characters.)

  Follow these steps to deploy an Appkit .war file:

  1. Ensure that [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) Java 1.8 is installed.

     <Check>   We do not recommend OpenJDK, which is installed by default in various Linux distributions. We recommend using the Oracle JDK only.</Check>
  2. Install your servlet container of choice, such as [Tomcat 8](http://tomcat.apache.org/download-80.cgi).
  3. You will have been provided a web application archive (.war file) that contains an Appkit web application (such as `twigkit-search.war`). If using Tomcat, copy the provided .war file into Tomcat’s webapps folder.
  4. Start the servlet container.
  5. Several seconds later, a folder with the same name as the .war file will appear in the file system (for example, twigkit-search). You can then access the application in your browser at `http://localhost:8080/{contextPath}`, where `{contextPath}` is the name of the .war file (for example, `http://localhost:8080/twigkit-search/`). You can also access the Appkit logs in the file system at `{tomcat}/logs/catalina.out`.

  Congratulations, your Appkit application has been successfully installed.
</Accordion>

## See also

* [Building from Source](/docs/5/fusion/dev-portal/appkit/reference/app-deployment/building-from-source)
