# Using User Data

User Data represents a script that gets passed to an instance at creation time. This script enables automated installation of software and service configuration and environment variable setup while eliminating the requirement to use manual SSH access.  \[ Read more here **User Data** (Add link)]

### Prerequisites

* Access to the Qumulus Cloud platform.​
* Basic understanding of cloud instance configurations.​

**Follow the steps below to launch a new compute instance using User :**

{% @guideflow/guideflow-embed requestedUrl="https://app.guideflow.com/player/zpez6egc3p" %}

#### 1.  Navigate to Compute > Instances

#### 2. Click on the `Get Started and Create Instance` Button

#### 3. [Configure Instance Settings](../creating-an-instance#id-3.-configure-instance-settings):

* Entre Instance Details
* Select Image
* Configure Storage
* Choose Instance Type
* Networking & Security ( Defaults Applied )
* Configure Authentication

#### 4. User Data (Optional)

User Data allows you to run scripts during the initial launch of your instance, automating tasks such as software installation, updates, or setting environment variables.​

**Example for Apache Installation on Ubuntu:**

To automate the installation and setup of Apache, input the following script in the User Data field:​

```bash
#!/bin/bash
# Redirect output to log file & console
exec > >(tee /var/log/user-data.log | tee /dev/ttyS0) 2>&1

# Update package list
echo "Updating package list..."
apt-get update -y

# Install Apache Web Server
echo "Installing Apache Web Server..."
apt-get install -y apache2

# Enable Apache to start on boot
echo "Enabling Apache to start on boot..."
systemctl enable apache2

# Start Apache service
echo "Starting Apache Web Server..."
systemctl start apache2

# Create a simple HTML page
echo "Creating a default web page..."
echo "<h1>Welcome to Qumulus Cloud</h1>" > /var/www/html/index.html

echo "User data script execution completed successfully!"
```

{% hint style="info" %}
* A User Data script should not exceed 64 KB
* User Data should not include sensitive data such as passwords, API keys, or private keys, because this data remains accessible through instance metadata which runs through logs and metadata services.
{% endhint %}

#### 5. Review and Launch

* Review the Instance Summary displayed on the right.
* Click on `launch Instance` to create the Instance.

#### 6. Viewing Console Logs

Qumulus instances enable users to observe system messages and debug information directly from the instance console without requiring SSH access.

<img src="https://3660005933-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsvu2RQcJaL2Ksrks9hKE%2Fuploads%2FJ3YHYbVgvzxIffyAfQ1W%2Ffile.excalidraw.svg?alt=media&#x26;token=1f708a88-a837-476b-8511-089f577fc1a4" alt="" class="gitbook-drawing">

You can deploy instances rapidly through this streamlined procedure that delivers necessary configuration needs. Enjoy the flexibility and efficiency of Qumulus!
