Skip to main content

Get started with Databricks Apps

This article helps you get started with Databricks Apps using a step-by-step example to create a simple app in your Databricks workspace using a template that follows Databricks best practices.

This example walks you through:

  • Creating an app from a template
  • Viewing the app after it's deployed
  • Copying the app template to your computer for further development
  • Running the app locally
  • Re-deploying the app to your workspace

By the end of this article, you’ll be able to iterate on your app locally and deploy updates to Databricks.

Prerequisites

Before you complete this tutorial, make sure that your Databricks workspace and local development environment are configured correctly. See Set up your Databricks Apps workspace and development environment.

Step 1: Install dependencies

Open a terminal and run the following commands to:

  • Install the Python libraries required by the example app.
  • Create a local directory for the source and configuration files for your app.
Bash
pip install gradio
pip install pandas
mkdir gradio-hello-world
cd gradio-hello-world

gradio-hello-world is the local directory for your app files.

Step 2: Create the app

  1. In your Databricks workspace, click + New > App in the left sidebar.

  2. Under Install from a template, go to the Gradio tab.

  3. Choose the Hello world template.

    Select the Hello World template

  4. Name the app gradio-hello-world and click Install.

This creates a new app based on the selected template and deploys it to your workspace.

Step 3: View the app

After you create an app, it starts automatically and displays a URL that you can use to preview it. View the app URL and deployment status on the Overview page:

View the app details page after app deployment

Click the URL to view the app:

View the output of the hello world app locally

Step 4: Copy the app to your computer

After you create the app, you can download the source code to your local machine to customize it.

  1. Copy the first command under Sync the files:

    View the app details page after app creation

  2. In a terminal, navigate to the gradio-hello-world local directory that you created, then run the copied sync command.

    Bash
    databricks workspace export-dir /Workspace/Users/my-email@org.com/databricks_apps/gradio-hello-world_2025_06_09-18_38/gradio-hello-world-app .

    ...
    Export complete

    The command copies two new files to the directory named app.py and app.yaml. app.yaml defines the app’s configuration, including its entry point and permissions. app.py contains the code that implements the app’s functionality and user interface.

Step 5: Modify and test the app locally

  1. Optionally, customize and develop your app locally. For example, you might modify app.py to make the data interactive, add a theme or styling options, or allow data uploads.

  2. To test your app, run python app.py:

    Bash
    python app.py

    Running on local URL: http://127.0.0.1:7860
    ...
  3. To view the app, navigate to http://127.0.0.1:7860 in a browser window.

  4. Optionally, use the databricks apps run-local command to run and debug the app:

    Bash
    databricks apps run-local --prepare-environment --debug

    This command installs all dependencies and prepares the virtual environment, then starts the app and the debugger on port 5678. Navigate to http://localhost:8001 to view the app.

    To set breakpoints in Visual Studio Code, install the Python debugger extension, then go to Run > Start Debugging > Remote Attach.

Step 6: Re-deploy the app to your workspace

To re-deploy the app, copy the command under Deploy to Databricks Apps on the app details page:

Copy the command to deploy an app

Run the command from within the gradio-hello-world local directory.

The command succeeds with:

JSON
{
"create_time": "2025-06-09T19:36:50Z",
"creator": "my-email@org.com",
"deployment_artifacts": {
"source_code_path": "/Workspace/Users/1234abcd-5678-90ab-cdef-123456abcdef/src/abcd1234efgh5678ijkl9012mnop3456"
},
"deployment_id": "abcd1234efgh5678ijkl9012mnop3456",
"mode": "SNAPSHOT",
"source_code_path": "/Workspace/Users/my-email@org.com/databricks_apps/gradio-hello-world_2025_06_09-18_38/gradio-hello-world-app",
"status": {
"message": "App started successfully",
"state": "SUCCEEDED"
},
"update_time": "2025-06-09T19:36:51Z"
}

To view the deployment status, go to the Overview page for the app.

Next steps

Now that you deployed and customized your first app, you can:

  • Configure authorization to manage who can access and edit your app.
  • Integrate your app with Databricks platform features like Databricks secrets or Databricks SQL.
  • Share your app with other users in your workspace or across your organization.
  • Explore more app templates to experiment with different frameworks and capabilities.