Start and Stop a Production Instance

On this page

This page covers starting and stopping FusionAuth on servers you manage. To start and stop a local development instance, see Install Locally.

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. To stop every node for an update, see Update a Production Instance.

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:

$ docker compose up -d

To stop every service and keep the data volumes:

$ 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:

$ kubectl rollout restart deployment/my-release-fusionauth

To stop FusionAuth, scale the deployment to zero replicas:

$ 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:

$ sudo systemctl start fusionauth-search
$ sudo systemctl start fusionauth-app

To stop Fusionauth:

$ sudo systemctl stop fusionauth-app
$ sudo systemctl stop fusionauth-search

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

To start FusionAuth:

$ /usr/local/fusionauth/fusionauth-search/elasticsearch/bin/elasticsearch
$ /usr/local/fusionauth/fusionauth-app/bin/start.sh

To stop FusionAuth:

$ /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:

$ brew services start opensearch
$ brew services start fusionauth-app

To stop FusionAuth:

$ brew services stop fusionauth-app
$ brew services stop opensearch

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

To start FusionAuth:

\fusionauth\fusionauth-search\elasticsearch\bin\elasticsearch.bat
\fusionauth\fusionauth-app\bin\start.ps1

To stop FusionAuth:

\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:

net start FusionAuthSearch
net start FusionAuthApp

To stop FusionAuth:

net stop FusionAuthApp
net stop FusionAuthSearch