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

# Gravity Installation

Gravity is an open-source, containerized Kubernetes framework that allows containerized applications like Data Science & AI Workbench to be delivered in a self-contained installer that includes a special containerized implementation of Kubernetes. Anaconda has shipped Data Science & AI Workbench in a Gravity package since its first release.

<Warning>
  Due to changes in the business model of [Teleport](https://goteleport.com/), the original developers of Gravity, Anaconda is limiting the use of Gravity-based installers to existing customers and [plans to end support for Gravity entirely at some point in the future](/docs/data-science/latest/reference/gravity-support). Existing Gravity customers are strongly encouraged to migrate their cluster to our new K3s implementation as soon as possible. Anaconda has developed a special process that allows you to migrate from Gravity to K3s without losing any of your existing data!
</Warning>

After you have verified that your [environment is prepared for installation](/docs/data-science/latest/environment-prep/gravity-prep) by completing the [pre-installation checklist](/docs/data-science/latest/environment-prep/gravity-prep#pre-installation-checklist), you’re ready to install the cluster!

<Note>
  The Gravity installation process only sets up a single control plane node. Once installation is complete, you can [add additional nodes](/docs/data-science/latest/admin/resources/gravity/add-remove-node) as necessary, including GPUs.
</Note>

1. Open a terminal on the master node and log in to a service account with sudo access.

2. Download the installer by running the following command:

   ```sh theme={null}
   # Replace <INSTALLER_LOCATION> with the provided location of the installer
   curl -O <INSTALLER_LOCATION>
   ```

   <Note>
     If you are in an air-gapped environment, you must deliver the installer to the master node in an alternate manner.
   </Note>

3. Decompress the installer and enter the top directory by running the following commands:

   ```sh theme={null}
   # Replace <INSTALLER> with the installer file you just downloaded
   tar xzvf <INSTALLER>
   cd <INSTALLER>
   ```

4. Set up and initialize your conda environment by running the following command:

   ```sh theme={null}
   ./conda-bootstrap.sh
   ```

5. Enter `yes` to allow the installer to initialize your `ae5-conda` environment by running `conda init` when prompted.

6. Verify your environment successfully created by running the following command:

   ```sh theme={null}
   conda env list
   ```

   <Note>
     This command returns a list of existing conda environments. You should see a `base` environment present with an asterisk beside the directory to indicate it is currently active.
   </Note>

7. Perform the Anaconda preflight system check on the master node by running the following command:

   ```sh theme={null}
   ae-preflight
   ```

   <Note>
     You will receive an overall `PASS` or `WARN` result from the script. The output is captured in a `results.txt` file for later reference, if necessary. If something goes wrong, you can view the results to determine the issue and correct it.
   </Note>

8. Create a file named `values.yaml` and populate it with the following content:

   ```yaml theme={null}
   # Replace <HOSTNAME> with the fully qualified domain name of the host server
   # Replace <GID> with the group ID with read-write access to the shared network file system (NFS) volume
   # Replace <SERVER_FQDN> with the address of the shared NFS volume
   # Replace <SERVER_PATH> with the path to the shared NFS volume
   # By default, installs will use the full ae-editor image
   # Uncomment and add the following to the bottom if you want to use editor-lite:
       #image:
         #suffix: lite     
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: anaconda-enterprise-install
   data:
     values: |
       hostname: <HOSTNAME>
       persistence:
         groupID: <GID>
         nfs:
           server: <SERVER_FQDN>
           path: <SERVER_PATH>
   ```

   If you are installing a single-node cluster and you want to use the `/opt/anaconda/storage` volume for managed persistence, the `persistence:` section of the `values.yaml` can be entered as:

   ```yaml theme={null}
   persistence:
     pvc: anaconda-storage
   ```

   <Note>
     The direct use of `/opt/anaconda/storage` for managed persistence works *only* for single-node clusters. It must be replaced with a network file system (NFS) configuration *before* adding additional nodes to the cluster. Otherwise, sessions and deployments launched on the additional nodes will fail to start. For more information, see [managed persistence](/docs/data-science/latest/reference/understanding-ae5#managed-persistence).
   </Note>

9. Run the gravity installation command:

   ```sh theme={null}
   # Replace <ADVERTISE-ADDR> with the IP address you want to be visible to the other nodes. If you have a private network and all nodes can communicate on it, use the private IP address for the advertise address
   # Replace <CLUSTERNAME> with the name you're giving to your cluster. Alphanumeric characters and periods only
   # Replace <VALUES_PATH> with the filepath to the values.yaml file you just created
   sudo ./gravity install --advertise-addr=<ADVERTISE-ADDR> --cluster=<CLUSTERNAME> --config <VALUES_PATH> --service-uid=$(id -u) --cloud-provider=generic
   ```

   Here is an example of what the installation command looks like for a single-node cluster:

   ```sh theme={null}
   sudo ./gravity install --advertise-addr=192.168.1.1 --cluster=MyCluster --config ./values.yaml --service-uid=$(id -u) --cloud-provider=generic
   ```

   If you are using an alternate `TMPDIR`, prepend the command with this new value. For example:

   ```sh theme={null}
   sudo TMPDIR=/mytmp ./gravity install --advertise-addr=192.168.1.1 --cluster=MyCluster --config=./values.yaml --service-uid=$(id -u) --cloud-provider=generic
   ```

   <Warning>
     The `--service-uid` is the service account UID and cannot be a root user. If you are performing a reinstallation of Workbench, you must delete the previous `planet` user prior to setting the new `--service-uid`.
   </Warning>

10. Monitor the progress from the command line. Your output will look like this:

    ```
    * [0/100] starting installer
    * [0/100] preparing for installation... please wait
    * [0/100] application: AnacondaEnterprise:5.5.x
    * [0/100] starting non-interactive install
    * [0/100] initializing the operation
    * [20/100] configuring packages
    * [50/100] installing software
    ```

11. Allow time for the process to complete (approximately 20-30 minutes).

12. Create a local user account and password to log in to the Gravity Operations Center. To do so, enter the Gravity environment from any of the nodes by running the following command:

    ```sh theme={null}
    sudo gravity enter
    ```

13. Create a local user account and password by running the following command:

    ```sh theme={null}
    # Replace <EMAIL> with the email address for the account
    # Replace <PASSWORD> with a password for the account. The password must be six characters long
    gravity --insecure user create --type=admin --email=<EMAIL> --password=<PASSWORD> --ops-url=https://gravity-site.kube-system.svc.cluster.local:3009
    ```

14. Inform gravity that you have completed the installation by running the following command from within the Gravity environment:

    ```sh theme={null}
    gravity site complete
    ```

15. Open a web browser and navigate to your instance of Workbench.

    <Note>
      Your browser may initially refuse to connect due to the use of our generated, self-signed SSL certificates. You should temporarily permit your browser to proceed anyway. You will also have to do the same every time you start a new session or deployment, so it is best to complete the next step as soon as possible.
    </Note>

16. [Update your SSL certificates](./certs).

17. Proceed to the [post-install configuration steps](./config).
