---
title: "Connecting your Cloud Platform application with Code Studio"
date: "2024-12-27T11:13:08+00:00"
summary: "Connect your Cloud Platform app to Code Studio: Set up your environment, generate tokens, authenticate, and configure your project with our step-by-step guide."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/code-studio/connecting-your-cloud-platform-application-code-studio"
id: "dd282c83-7421-49f9-a286-418a654ab670"
---

To connect your Cloud Platform application with Code Studio:

1.  Configure your working environment by using one of the following steps:
    *   [Create a new Cloud IDE](/acquia-cloud-platform/add-ons/cloud-ide/creating-cloud-ide "Creating Cloud IDE") for the desired application.
    *   Open an existing Cloud IDE on the desired application.
    *   Open a [local environment](/resources/local-development "Local Development"), and install [Acquia CLI](/acquia-cloud-platform/add-ons/acquia-cli/install).
2.  [Generate a Cloud Platform API token](/acquia-cloud-platform/develop-apps/api/auth#cloud-generate-api-token), and make a note of the API key and API secret as you cannot retrieve them after closing your browser tab.
3.  Generate a Code Studio personal access token:
    
    1.  Log in to [Code Studio](http://code.acquia.com/).
    2.  Make sure the sidebar drawer is open, hover or click the icon on top left corner of the page.
    3.  Click your profile icon.
    4.  Click **Edit profile**.
        
        The system displays your user settings.
        
    5.  Click **Access Tokens**.
    6.  In the **Add a personal access token** section, provide the required details to create a new personal access token for authenticating with Code Studio.
    7.  In **Name**, enter a name for the token.
    8.  In **Selected Scopes**, select the **api** and **write\_repository** checkboxes.
    9.  Click **Create personal access token**.
        
        Code Studio creates your new personal access token and displays it on the screen.
        
    10.  Copy your new token.
    
    Important
    
    You must save your personal access token as you cannot access it again.
    
4.  Authenticate with Code Studio:
    *   If you are using a [Cloud IDE](/acquia-cloud-platform/add-ons/ide), run:
        
            glab auth login --hostname=code.acquia.com                                           
        
        Select _HTTPS_ when prompted.
        
    *   If you are using a local environment, configure the [SSH keys](/acquia-cloud-platform/manage-apps/command-line/ssh/getting-started) for Acquia Platform.
5.  Create and/or configure a Code Studio project for your Cloud Platform application with the following commands:
    
        acli update
        
        acli cs:wizard --gitlab-host-name=code.acquia.com                                                        
    
    When you create a project, the system prompts you to select the project type. This prompt appears only if your account has at least one codebase. You may choose to create one of the following:
    
    ![create-configure](https://acquia.widen.net/content/21f2dc03-0432-4b14-bdf4-5c58c31a72f7/web/ef78d_create%20or%20configure.png?w=512&itok=frm5vwR0)
    
    *   A Code Studio project for an application
    *   A Code Studio project for a codebase
    
    Before you run the **acli cs:wizard --gitlab-host-name=code.acquia.com** command, ensure that the assigned user role in Acquia Cloud has the following permissions:
    
    a. Pull and deploy code, files, or databases to non-production environments.  
    b. Add SSH key to git repository.  
    c. Add SSH key to non-production environments.  
    d. Add a CD environment.  
    e. Delete a CD environment.  
    f. Manage environment variables on a non-production environment.
    
    Refer to the [Acquia Cloud documentation](https://docs.acquia.com/acquia-cloud-platform/working-roles-and-permissions) for the steps to create, view, assign, edit, or delete role permissions.
    
6.  The [ACLI](/acquia-cloud-platform/add-ons/acquia-cli/commands/codestudio:wizard) command walks you through the following process:
    
    *   (prompt) Creating an API token for Code Studio
    *   (automated) Creating an SSH key for Code Studio
    *   (automated) Setting GitLab CI/CD variables
    *   (automated) Creating a scheduled pipeline for automatic updates
    *   (automated) Pushing your Cloud Platform application code to Code Studio
    
    When the setup wizard prompts for the token key and secret, paste the the API key and API secret that you noted while generating the token.
    

Note

Cloud Platform sends an email to your user account notifying that an SSH key labeled `CODESTUDIO_+key` is added to your Acquia account. This is a normal, expected, and secure email that serves as a notification.