---
title: "Virtual Machines | Speedscale Docs"
description: "Learn how to install Speedscale on a virtual machine with comprehensive, step-by-step instructions outlined in the official documentation. This guide covers system requirements, installation procedures, and troubleshooting tips to help you effectively set up Speedscale."
canonical: "https://docs.speedscale.com/getting-started/installation/install/vm/"
---

[Documentation index](https://docs.speedscale.com/getting-started/llms.txt) | [Markdown](https://docs.speedscale.com/getting-started/installation/install/vm/index.md) | [Canonical page](https://docs.speedscale.com/getting-started/installation/install/vm/)

# Virtual Machines

<a id="prerequisites"></a>

## Prerequisites

1.  [Speedctl is installed](https://docs.speedscale.com/getting-started/quick-start/)

<a id="setting-up-local-capture"></a>

## Setting up local capture

Run:

```bash
speedctl capture <service_name> <service_port> --daemon
```

This will setup Speedscale proxies for both inbound and outbound capture.

To test out the inbound capture mechanism, you can make requests as you normally would but using `localhost:4143` instead of the port your app is serving on.

To configure outbound capture, configure your application to use the socks [proxy](https://docs.speedscale.com/reference/glossary/#proxy) running on `*:4140` on your server, and configure it to [trust the local certificates](https://docs.speedscale.com/getting-started/installation/sidecar/tls/#trusting-tls-certificates).

<a id="setting-up-global-capture"></a>

## Setting up global capture

The steps above setup an inbound proxy on port `4143` that forwards requests to your app but so far we've only captured request explicitly going to that port. To capture all existing traffic going into your app, you'll need to edit your load balancer.

**AWS**

<a id="create-a-new-target-groupbackend"></a>

### Create a new target group/backend

![Target Groups](https://docs.speedscale.com/assets/images/target-groups-1-32c60a21722e602c729b2ae5106f19d2.png)

We have an existing target group going to our app which serves on port `8080`. We're going to create a new one with identical settings, the only difference will be the port `4143`.

Make sure to configure the health check correctly, it should be identical to the existing one.

![Target Groups](https://docs.speedscale.com/assets/images/target-groups-2-e75091a41dda6e3d7735f998a467d010.png)

<a id="check-the-security-groups"></a>

### Check the security groups

Make sure the security groups/firewall rules for the load balancer and the VM allow traffic to flow between them.

The inbound group for the EC2 should allow traffic on `4143`

![Security Group](https://docs.speedscale.com/assets/images/sg-1-70974992afc659b7c5dd20fc20bf49a1.png)

The outbound group for the ALB should allow traffic out to `4143` as well

![Security Group](https://docs.speedscale.com/assets/images/sg-2-a7d9c39bff668db4fd65e21a45f6f638.png)

<a id="modify-the-listener"></a>

### Modify the listener

![Listeners](https://docs.speedscale.com/assets/images/listeners-1-aeeaf3130c6e02c409c77619a531eb32.png)

We have an existing listener where HTTP traffic is forwarded to our listener called `user` that hit our app directly. We're going to edit this so that the load balancer forwards traffic to our new target group.

![Listeners](https://docs.speedscale.com/assets/images/listeners-2-038b42493e47a535976857ae1abba33a.png)

That's it! Now all traffic will be forwarded to the Speedscale proxy and be available for analysis

**Google Cloud**

<a id="add-a-named-port"></a>

### Add a named port

![Instance Group](https://docs.speedscale.com/assets/images/instance-group-b810bd4756d4f9803002eb8f7f484fb5.png)

We have an existing instance group going to our app with a defined port `8080`. We're going to add `4143` to our instance group for the proxy.

<a id="create-a-backend"></a>

### Create a backend

![Backend](https://docs.speedscale.com/assets/images/lb-backend-e5fd2f988154384402dd81460cc862e9.png)

Create a new backend which points to the instance group but with our new port.

<a id="modify-the-load-balancer"></a>

### Modify the Load Balancer

![Load Balancer](https://docs.speedscale.com/assets/images/load-balancer-3b4753325e48d6bc1beaaf06d2357b09.png)

We have an existing load balancer where HTTP traffic is forwarded to our original backend that hit our app directly. We're going to edit this so that the load balancer forwards traffic to our new target group.

That's it! Now all traffic will be forwarded to the Speedscale proxy and be available for analysis

<a id="analyze-traffic"></a>

## Analyze Traffic

![Traffic](https://docs.speedscale.com/assets/images/traffic-3767b57af3b6e6e4433ea6bb26972322.png)

You should be able to see traffic in the Speedscale UI after a few minutes and now you can using this traffic to [create a snapshot](https://docs.speedscale.com/guides/creating-a-snapshot/).

<a id="replaying-traffic"></a>

## Replaying Traffic

Replaying traffic is similar to the capture step above. Run `speedctl replay <snapshot_id>`

This will generate a [report](https://docs.speedscale.com/reference/glossary/#report) which you can find on the [reports page](https://docs.speedscale.com/guides/reports/).
