# Add other required environment variables
```

</StepItem>

<StepItem>

Build the application

```bash copy
npm run build
```

</StepItem>

<StepItem>

Run the application

```bash copy
node --import=./.mastra/output/instrumentation.mjs --env-file=".env" .mastra/output/index.mjs
```

:::note
Your Mastra application will run on port 4111 by default. Ensure your reverse proxy is configured to forward requests to this port.
:::

</StepItem>

</Steps>

</TabItem>

</Tabs>

## Connect to your Mastra server

You can now connect to your Mastra server from your client application using a `MastraClient` from the `@mastra/client-js` package.

Refer to the [`MastraClient` documentation](/docs/server-db/mastra-client) for more information.

```typescript copy showLineNumbers
import { MastraClient } from "@mastra/client-js";

const mastraClient = new MastraClient({
  baseUrl: "https://<your-domain-name>",
});
```

## Next steps

- [Mastra Client SDK](/reference/client-js/mastra-client)
- [Digital Ocean App Platform documentation](https://docs.digitalocean.com/products/app-platform/)
- [Digital Ocean Droplets documentation](https://docs.digitalocean.com/products/droplets/)


---
title: "Cloud Providers | Deployment"
description: "Deploy your Mastra applications to popular cloud providers."
---