# Getting Started with Terraform

## Installing and Configuring Terraform for Crusoe Cloud

This Quick Start Guide will walk you through the process of installing and configuring Terraform for use with Crusoe Cloud.

### Step 1: Prerequisites

Ensure that your system meets the following prerequisites before proceeding:

- Operating System: Compatible with Windows, macOS, or Linux.
- Internet Connection: Required for downloading Terraform and related dependencies.
- Crusoe Account: Ensure you have an active Crusoe account to access resources.

### Step 2: Download Terraform

1. Visit the official [Terraform website](https://www.terraform.io/)
2. Navigate to the "Downloads" section and choose the appropriate version for your operating system.
3. Follow the installation instructions provided on the Terraform website to complete the installation.

### Step 3: Verify Installation

4. Open a terminal or command prompt.
5. Run the following command to verify the successful installation:

```sh
terraform --version
```

This should display the installed Terraform version, confirming a successful installation.

### Step 4: Authenticate with Crusoe

6. Terraform looks for a config file at `~/.crusoe/config` which contains credentials as well as any defaults.
7. Please follow the steps to create API keys by heading to [Managing API keys](../identity-and-security/managing-api-keys.mdx)
8. At a minimum, the following options are required to authenticate to the Crusoe API:

```sh
[default]
default_project="default"
access_key_id="<access_key_id>"
secret_key="<secret_key>"
```

Replace `default_project` with your actual project name, `access_key_id` and `secret_key` with your actual access key and secret key.

### Step 5: Configure Terraform for Crusoe

9. Open your terminal or command prompt.
10. Navigate to the directory where you want to store your Terraform configurations.
11. Create a new file named `main.tf` in the same directory and add the following to your Terraform configuration code.

```hcl
// Crusoe Provider
terraform {
  required_providers {
    crusoe = {
      source = "registry.terraform.io/crusoecloud/crusoe"
    }
  }
}
```

12. Run the following command to initialize Terraform in the directory: `terraform init`

## Conclusion

You have successfully installed and configured Terraform for use with Crusoe Cloud! Now, you can start creating resources. For example, visit [Manage your VMS](/compute/virtual-machines/managing-vms) and click on the “Terraform” tab to create a VM. If you run into any issues, [contact support](../resources/support.md).