# Start and Stop a Production Instance

Learn how to start and stop the FusionAuth services on a production server, in Docker, and in Kubernetes.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

This page covers starting and stopping FusionAuth on servers you manage. To start and stop a local development instance, see [Install Locally](https://fusionauth.io/docs/get-started/install.md#start-stop-and-reset).

## Start and Stop Order

FusionAuth uses the database and the search engine to store and retrieve users. Start the search engine before FusionAuth App, and stop the search engine last. Start the database before FusionAuth App as well.

## Remove a Node From a Cluster

In a cluster, take a node out of the load balancer before you stop the node. Otherwise the load balancer keeps sending login traffic to the stopped node. For the full steps, see [Cluster](https://fusionauth.io/docs/deploy/production/cluster.md). To stop every node for an update, see [Update a Production Instance](https://fusionauth.io/docs/update/prod-instance.md).

## Commands

The macOS and Windows examples assume an installation directory of `/usr/local/fusionauth` and `\fusionauth`. Adjust the paths for your installation directory.

Run these commands from the directory that contains your `docker-compose.yml` file. To start every service in the background:

```shell-session
$ docker compose up -d
```

To stop every service and keep the data volumes:

```shell-session
$ docker compose stop
```

Don't use `docker compose down -v` on a production instance. The `-v` flag deletes the database volume.

Kubernetes starts and stops pods for you. To restart every FusionAuth pod one at a time, restart the deployment. Replace `my-release-fusionauth` with the name of your deployment:

```shell-session
$ kubectl rollout restart deployment/my-release-fusionauth
```

To stop FusionAuth, scale the deployment to zero replicas:

```shell-session
$ kubectl scale deployment/my-release-fusionauth --replicas=0
```

To start FusionAuth again, scale the deployment back to the number of replicas you run.

FusionAuth installation using Debian or RPM packages also installs the `fusionauth-search` and `fusionauth-app` services. Use these services to start and stop FusionAuth.

To start FusionAuth:

```shell-session
$ sudo systemctl start fusionauth-search
```

```shell-session
$ sudo systemctl start fusionauth-app
```

To stop Fusionauth:

```shell-session
$ sudo systemctl stop fusionauth-app
```

```shell-session
$ sudo systemctl stop fusionauth-search
```

If you'd prefer to use the native Elastic and Tomcat scripts, follow the macOS instructions.

To start FusionAuth:

```shell-session
$ /usr/local/fusionauth/fusionauth-search/elasticsearch/bin/elasticsearch
```

```shell-session
$ /usr/local/fusionauth/fusionauth-app/bin/start.sh
```

To stop FusionAuth:

```shell-session
$ /usr/local/fusionauth/fusionauth-app/bin/stop.sh
```

Always stop Elasticsearch last. If you started Elasticsearch using the `elasticsearch` script, shut Elasticsearch down by closing that terminal window.

To start FusionAuth:

```shell-session
$ brew services start opensearch
```

```shell-session
$ brew services start fusionauth-app
```

To stop FusionAuth:

```shell-session
$ brew services stop fusionauth-app
```

```shell-session
$ brew services stop opensearch
```

On Windows, you can run FusionAuth using either native PowerShell scripts, or Windows services.

To start FusionAuth:

```powershell
\fusionauth\fusionauth-search\elasticsearch\bin\elasticsearch.bat
```

```powershell
\fusionauth\fusionauth-app\bin\start.ps1
```

To stop FusionAuth:

```powershell
\fusionauth\fusionauth-app\bin\stop.ps1
```

Always stop Elasticsearch last. If you started Elasticsearch using the `elasticsearch.bat` script, shut it down by closing that command window.

To start FusionAuth:

```powershell
net start FusionAuthSearch
```

```powershell
net start FusionAuthApp
```

To stop FusionAuth:

```powershell
net stop FusionAuthApp
```

```powershell
net stop FusionAuthSearch
```

Related

[Deploy Microsoft Azure Kubernetes Service (AKS) Learn how to provision an AKS cluster in Microsoft Azure. dockerkubernetes](https://fusionauth.io/docs/deploy/production/kubernetes/aks.md)

[Deploy Elastic Kubernetes Service (EKS) Learn how to provision an EKS cluster in AWS. dockerkubernetes](https://fusionauth.io/docs/deploy/production/kubernetes/eks.md)

[Deploy Deploy with k8s Learn how to deploy FusionAuth in a Kubernetes Cluster. dockerkubernetes](https://fusionauth.io/docs/deploy/production/kubernetes/fusionauth-deployment.md)

[Deploy Google Kubernetes Engine (GKE) Learn how to provision a GKE cluster in Google Cloud (GCP). dockerkubernetes](https://fusionauth.io/docs/deploy/production/kubernetes/gke.md)
---

## Other pages in Production

> For the full index of this section, see [Deploy](https://fusionauth.io/docs/llms-deploy.txt).

- [FusionAuth CLI](https://fusionauth.io/docs/deploy/production/cli.md): Learn about the FusionAuth CLI tool.
- [Configure a FusionAuth sCluster](https://fusionauth.io/docs/deploy/production/cluster.md): Learn how to set up a multi-node FusionAuth cluster.
- [Configuration Reference](https://fusionauth.io/docs/deploy/production/configuration.md): Learn about the configuration options for FusionAuth.
- [Air-gapping](https://fusionauth.io/docs/deploy/production/install/air-gapping.md): Run FusionAuth with no network access (air-gapped).
- [Install a Database](https://fusionauth.io/docs/deploy/production/install/database.md): Learn how to install the database that FusionAuth will use to store user data.
- [Customize Docker Images](https://fusionauth.io/docs/deploy/production/install/docker-configuration.md): Learn how to configure a Docker image containing FusionAuth to meet the needs of your application.
- [Install FusionAuth App](https://fusionauth.io/docs/deploy/production/install/fusionauth-app.md): Learn how to install FusionAuth App on a production server with Docker or from a package.
- [Packages](https://fusionauth.io/docs/deploy/production/install/packages.md): Learn how to determine which installation packages you need.
- [Install a Search Engine](https://fusionauth.io/docs/deploy/production/install/search.md): Learn how to install a search engine for your FusionAuth instance.
- [Silent Mode](https://fusionauth.io/docs/deploy/production/install/silent-mode.md): This is a guide to using silent mode during FusionAuth install and updates.
- [Microsoft Azure Kubernetes Service (AKS)](https://fusionauth.io/docs/deploy/production/kubernetes/aks.md): Learn how to provision an AKS cluster in Microsoft Azure.
- [Elastic Kubernetes Service (EKS)](https://fusionauth.io/docs/deploy/production/kubernetes/eks.md): Learn how to provision an EKS cluster in AWS.
- [Deploy with k8s](https://fusionauth.io/docs/deploy/production/kubernetes/fusionauth-deployment.md): Learn how to deploy FusionAuth in a Kubernetes Cluster.
- [Google Kubernetes Engine (GKE)](https://fusionauth.io/docs/deploy/production/kubernetes/gke.md): Learn how to provision a GKE cluster in Google Cloud (GCP).
- [Kubernetes](https://fusionauth.io/docs/deploy/production/kubernetes.md): Learn how to deploy and test FusionAuth using Kubernetes.
- [Local Cluster with minikube](https://fusionauth.io/docs/deploy/production/kubernetes/minikube.md): Learn how to provision minikube for local development and testing of FusionAuth kubernetes deployments.
- [AWS](https://fusionauth.io/docs/deploy/production/marketplaces/aws.md): Learn how to use FusionAuth with the AWS Marketplace.
- [DigitalOcean](https://fusionauth.io/docs/deploy/production/marketplaces/digitalocean.md): Learn how to use FusionAuth with the DigitalOcean Marketplace.
- [Google Cloud](https://fusionauth.io/docs/deploy/production/marketplaces/google-cloud.md): Learn how to use FusionAuth with the GCP Marketplace.
- [Install from a Marketplace](https://fusionauth.io/docs/deploy/production/marketplaces.md): Learn how to install FusionAuth using cloud marketplaces or templates.
- [Render](https://fusionauth.io/docs/deploy/production/marketplaces/render.md): Set FusionAuth up on Render from a Blueprint.
- [Proxy FusionAuth](https://fusionauth.io/docs/deploy/production/proxy-setup.md): Learn more about HTTP proxies and FusionAuth.
- [Server Layout](https://fusionauth.io/docs/deploy/production/server-layout.md): Learn about the different server layouts that FusionAuth can be installed with to optimize performance and security.
- [System Requirements](https://fusionauth.io/docs/deploy/production/system-requirements.md): Learn the minimum system requirements required to install and run FusionAuth.
- [Manage FusionAuth With Terraform](https://fusionauth.io/docs/deploy/production/terraform.md): Learn how to create and change FusionAuth configuration with the FusionAuth Terraform provider.
