US flag signifying that this is a United States Federal Government website An official website of the United States government

Try cloud.gov for free

Follow this guide to create an account and deploy a sample app in your own free sandbox.

Get trial access and a free sandbox space

Federal employees and contractors with an email ending in .mil, .gov, or .fed.us can obtain a free sandbox space. To register, you’ll need access to your email and a smartphone with Google Authenticator installed.

Get access

Go build in your sandbox

Follow any of the tutorials to launch your own web application from your sandbox. You’ll need your cloud.gov account and some familiarity with Windows Powershell or Mac/Linux terminal. Learn more about sandbox spaces and sandbox limitations.

Part 1: Why cloud.gov?

27 minutes

Get an overview of the cloud.gov platform and how it reduces lead time, and ensures security and compliance.

Part 2: Getting set up

4 minutes

A walk-through of the initial registration process (starts at 3:01), including the setup of your one-time password application.

Part 3: Hands-on workshop

41 minutes

Install the Cloud Foundry tools, connect to cloud.gov, and start running applications — from a static site, to a multi-node application with a data backend. We introduce you to the cloud.gov architecture and concepts, and touch on logging and debugging your running application.

Install the Cloud Foundry command line tool

Install the CloudFoundry command line interface (CLI)

Since cloud.gov is based on the open-source Cloud Foundry project, it uses the Cloud Foundry CLI. Download and install the CLI for your system:

Test your install with following command:

cf help

Deploy the sample app

Now that you have your account and the CLI installed, let’s deploy a Java web application by downloading the application code, connecting to cloud.gov, and “pushing” the application.

Download the application code from 18F's GitHub repository

If you have Git installed:

git clone https://github.com/18F/cf-sample-app-spring
cd cf-sample-app-spring

If you don’t have Git installed, download master.zip from the repository, unzip master.zip, then:

cd cf-sample-app-spring-master
Connect to cloud.gov
cf login -a https://api.fr.cloud.gov --sso

Complete the login in your browser at https://login.fr.cloud.gov/passcode. You’ll get a one-time passcode, which you then paste into your terminal.

Push the application
cf push

The push command will upload your sample app, prepare it for cloud.gov, then after a couple minutes tell you what URL to visit in your browser. Look for the urls: line, as in this example output:

cf push
Using manifest file ...

Creating app cf-spring in org / space
OK
...[snip]...
requested state: started
instances: 1/1
usage: 768M x 1 instances
urls: cf-spring-subpeltate-briner.app.cloud.gov
last uploaded: Fri Nov 3 17:50:30 UTC 2017
stack: cflinuxfs2
buildpack: client-certificate-mapper.... [snip]

     state     since
#0   running   2017-12-02 12:53:29 PM
View your application

Use your browser to visit the urls: from the push command (in the above example, https://cf-spring-subpeltate-briner.app.cloud.gov). Your browser should display something like this:

Congratulations! You now have a running webapp built on the Java Spring framework.

Exploring other cloud.gov features

Visit the dashboard — https://dashboard.fr.cloud.gov/ — to see your options for managing your application via your browser.

View your application logs with cf logs --recent or with the web-based logviewer at https://logs.fr.cloud.gov

If you’re done, you can delete your app by running cf delete <APPNAME> (it’s up to you whether to keep it running for more experiments or delete it).

Install the CloudFoundry command line interface (CLI)

Since cloud.gov is based on the open-source Cloud Foundry project, it uses the Cloud Foundry CLI. Download and install the CLI for your system:

Test your install with following command:

cf help

Deploy a Hello World app

Now that you have your account and the CLI installed, let’s download the "Hello World" samples, choose one, connect to cloud.gov and "push" the application code.

Download the Hello World code examples from 18F's GitHub repository

If you have Git installed:

git clone https://github.com/18F/cf-hello-worlds
cd cf-hello-worlds

If you don’t have Git installed, download master.zip from the repository, unzip master.zip, then:

cd cf-hello-worlds-master
Choose a framework

There are subdirectories for a number of different language + framework combinations. Choose an <example>, then

cd <example>

E.g., cd python-flask

Regardless of the framework you choose, the remaining steps are all the same.

Connect to cloud.gov
cf login -a https://api.fr.cloud.gov --sso

Complete the login in your browser at https://login.fr.cloud.gov/passcode. You’ll get a one-time passcode, which you then paste into your terminal.

Push the application
cf push

The push command will upload your sample app, prepare it for cloud.gov, then after a couple minutes tell you what URL to visit in your browser. Look for the urls: line, as in this example output:

cf push
Using manifest file ...

Creating app dotnet-core in org / space
OK
...[snip]...
requested state: started
instances: 1/1
usage: 512M x 1 instances
urls: dotnet-core-nongraphical-logogram.app.cloud.gov
last uploaded: Sat Dec 2 17:51:57 UTC 2017
stack: cflinuxfs2
buildpack: dotnet-core

     state     since
#0   running   2017-12-02 12:53:29 PM
View your application

Use your browser to visit the urls: from the push command (in the above example, https:/dotnet-core-nongraphical-logogram.app.cloud.gov). It should just display Hello World from and the name of your programming language example.

Congratulations! You now have a running web app built on the language and framework of your choice.

Exploring other cloud.gov features

Visit the dashboard — https://dashboard.fr.cloud.gov/ — to see your options for managing your application via your browser.

View your application logs with cf logs --recent or with the web-based logviewer at https://logs.fr.cloud.gov

If you’re done, you can delete your app by running cf delete <APPNAME> (it’s up to you whether to keep it running for more experiments or delete it).

Additional resources

If you've run into any issues with these tutorials, please Contact support at cloud.gov. We're happy to help.

Did we miss a tip or useful resource that you think we should add? Submit a suggestion on GitHub or send us an email.

Want more?

Upgrade to a paid package to get full access to the platform and permanent spaces for hosting longer term demos and web applications in production. Email us at cloud-gov-inquiries@gsa.gov to learn more about what cloud.gov can do.

Contact us