Configure your Deephaven instance

This page shows how to take your Deephaven instance beyond the defaults: set up authentication, choose a different image, add Python packages, give it more memory, and keep it up to date. The Docker examples build on the command you ran in Get started. If you installed with pip, the last section shows how to do the same tasks.

Authentication

Keeping your real-time data secure is one of Deephaven's top priorities. By default, Deephaven uses pre-shared key (PSK) authentication. In Get started, you set the key with the -Dauthentication.psk flag in the docker run command.

  • With the flag, your key stays the same across server restarts.
  • Without the flag, Deephaven generates a new random key each time the server starts.

For enhanced security, replace the placeholder YOUR_PASSWORD_HERE in the -Dauthentication.psk flag with your own long, hard-to-guess key:

In both cases, Deephaven prints the key in the server logs on startup, so you can find it there if you forget it. With the command from Get started, the logs print in the terminal where you ran docker run. The key appears in a line like this one from a Docker Compose log:

Docker Compose logs showing the PSK

To learn more about PSK authentication, see the PSK authentication guide.

In addition to PSK authentication, Deephaven supports the following types of authentication:

Choose an image

Deephaven provides multiple Docker images, called deployments. Each image is available in several versions, such as latest or a specific release.

The images that start a Python console, such as the server image you ran in Get started, come pre-installed with different Python packages. For example, the server-all-ai image comes pre-installed with PyTorch, TensorFlow, scikit-learn, and NLTK. To use server-all-ai, swap the image name in your Get started command:

Unlike server, server-all-ai doesn't include the Deephaven Express and deephaven.ui plugins that the Real-time Plots and deephaven.ui pages of this crash course use. Run server if you want to run those examples. Deephaven loads plugins when the server starts, so installing them from the IDE doesn't make them available. To add them to server-all-ai, build a custom Docker image that starts from server-all-ai:

You can also run Deephaven with Deephaven's example data, Redpanda, or both. Deephaven publishes pre-built docker-compose.yml files that do this. To pick one and start it, see Choose a deployment.

To learn more about deployments, check out the guide for installing Deephaven with Docker.

Install Python packages

Whichever image you run, you'll likely need to install Python packages it doesn't include at some point. You can install packages from within the Deephaven IDE:

The commands on this page start the container with --rm, so when you stop the container, Docker removes it along with any packages you installed. To learn about persistent package installations, see the user guide on installing Python packages.

Give Deephaven more memory

Large datasets require significant memory. Deephaven runs on the Java Virtual Machine (JVM), and the JVM's maximum heap size caps how much memory Deephaven can use for data. You set it with the -Xmx flag. If you don't, the JVM picks a size based on the memory available, which is often too small for large data.

Fortunately, it's easy to give Deephaven more memory:

  1. On Docker Desktop, raise the memory limit under Settings > Resources > Advanced, as described in the Docker Desktop settings documentation. Containers can use only as much memory as Docker Desktop allows, which by default is half of your machine's memory.
  2. Add the -Xmx flag to the START_OPTS environment variable you used in Get started. Separate multiple JVM options with spaces. The new START_OPTS value replaces the old one, so include your pre-shared key in it too.

Here's the docker run command from Get started with a 16 GB maximum heap added:

The memory guide explains more about allocating memory in Deephaven.

Keep your instance up to date

The data world is ever-evolving, and so is Deephaven. It's easy to keep your instance up to date and get the latest features and bug fixes.

To update, pull the latest version of the image you run. For the Get started image, that's:

Then stop your running container and start a new one with the same docker run command you used in Get started. To stop the container, press Ctrl+C in its terminal or run docker stop deephaven. Because the Get started command mounts ./data, your saved files carry over.

If you run Deephaven from a docker-compose.yml file or your own Dockerfile, see the guide to updating Docker-installed Deephaven to set the image version there.

If you installed Deephaven with pip

This crash course runs Deephaven with Docker. If you installed Deephaven with pip instead, the steps above work differently.

Set the pre-shared key and the maximum heap size with the jvm_args parameter when you start the Deephaven server:

Deephaven can import every package in the Python environment where you installed deephaven-server, so packages you install there persist across server restarts. To add a package, run pip install in that environment:

Update the Deephaven Python package the same way you'd update any Python package: