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

# Deploy a Ruby on Rails Template

> Deploy a starter template Ruby on Rails app on Aptible

> [card] [Deploy Now](https://app.aptible.com/create)

> [card] [GitHub Repo](https://github.com/aptible/template-rails)

> [card] [View Example](https://app-52710.on-aptible.com/)

# Overview

This guide will walk you through the process of launching the [Rails Getting Started example](https://guides.rubyonrails.org/v4.2.7/getting_started.html) from the Aptible Dashboard.

# Deploying the template

> [!NOTE]
>
> Prerequisite: Ensure you have [Git](https://git-scm.com/downloads) installed.

Using the [Deploy Code](https://app.aptible.com/create) tool in the Aptible Dashboard, you can deploy the **Ruby on Rails Template**. The tool will guide you through the following:

**1. Deploy with Git Push**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby1.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=96256d53258cc6e13216dbc8e89a66ae)

**2. Add an SSH key**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby2.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=e207be0a7eb863176c65af7906f09f5d)

If you have not done so already, you will be prompted to set up an [SSH key](https://www.aptible.com/docs/core-concepts/security-compliance/authentication/ssh-keys.md#ssh-keys).

**3. Environment Setup**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby3.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=3f1c2f75f944a64f613a5b2e73bd040e)

Select your [stack](https://www.aptible.com/docs/core-concepts/architecture/stacks.md) to deploy your resources. This will determine what region your resources are deployed to. Then, name the [environment](https://www.aptible.com/docs/core-concepts/architecture/environments.md) your resources will be grouped into.

**4. Prepare the template**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby4.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=d903342f3d08fc201483957abccef969)

Select `Ruby on Rails Template` for deployment, and follow the command-line instructions.

**5. Fill environment variables and deploy!**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby5.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=249b7e4498403168cac4953860df1062)

Aptible will automatically fill this template's required databases, services, and app's configuration with environment variable keys for you to fill with values. Once complete, save and deploy the code!

**6. View logs in real time**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby6.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=f978f55674e2f3b3b402c919fb2f38d5)

**7. Expose your app to the internet**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby7.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=0e1dae20dbf4e1357ff608032a80b439)

Now that your code is deployed, it's time to expose your app to the internet. Select the service that needs an [endpoint](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/overview.md), and Aptible will automatically provision a managed endpoint.

**8. View your deployed app 🎉**

![](https://mintcdn.com/aptible/RWSo_H5DBAoWcXSD/images/ruby8.png?fit=max\&auto=format\&n=RWSo_H5DBAoWcXSD\&q=85\&s=50dab00f12fa2b4ed94524a909ff8431)

# Continue your journey

> [card] [Deploy custom code](https://www.aptible.com/docs/custom-code-quickstart.md)
>
> Read our guide for deploying custom code on Aptible.
