How can I download anvil app (created by online editor) to local PC?

What I’m trying to do:
I want to create anvil project at online editor, and download it to local PC(server) and service

What I’ve tried and what’s not working:
I can’t find any menu can download the anvil app

Code Sample:

# this is a formatted code snippet.
# paste your code between ``` 

Clone link:
share a copy of your app

Apps made by Anvil are Web Apps which you can publish to a URL or a Custom Domain of your own.

All Anvil Apps are Progressive web apps though which means that even though they are a website, they can installed on your phone or PC.

When you visit your app on the given URL, you will see a popup asking you to download on some browsers. Otherwise you can take a look at this post

3 Likes

A couple of other possibilities, given the question.

If you’re talking about running the Anvil App locally, you want the open source Anvil runtime: https://github.com/anvil-works/anvil-runtime

If you’re talking about downloading a local backup of your code, you want to download a copy using Git: Anvil Docs | Git

6 Likes

This link Anvil Docs | Collaborating with Git and GitHub gives some info about downloading the code of your App, but does not explain other possibilities.

To download your Anvil app’s code to your computer (without using GitHub), use Anvil’s built-in Git integration, which allows local cloning and export of your entire app. Follow these steps:

Steps to Download Anvil App Code Locally

  • Open your app in the Anvil online editor.
  • Click the gear icon (App Menu) at the top of the sidebar and select “Version History”.

Version History

  • In the “Version History” window, find the “Clone with Git” button. Click it to display a git clone command.

Clone with Git

  • Copy the provided git clone command.
  • Open a terminal on your local computer and run the command. It will look like:
    git clone ssh://username@anvil.works:2222/APP_ID.git MyAnvilApp
    
  • This will create a local folder (MyAnvilApp) containing all the app code and resources, fully independent of GitHub.

Additional Notes

  • This method gives you the complete app, including server and client code, in a portable format suitable for use with the Anvil App Server or as a backup.[4][3]
  • If you wish to run the app locally, install the open-source Anvil App Server (pip install anvil-app-server) and follow its documentation.[5][3][4]

This workflow lets you work entirely offline and is not tied to GitHub or other external repositories.[2][1]

1
2
3
4
5


For completeness … I just found out another quick way to download the project/app, but it is very different.

I puts everything on a single yaml file. Handy if you want to find some project parameters/setting.

In settings > collaboration > Download > Download as a File

PS: Some images seem to display weird, while on the editor they show perfect. If someone knows why / how to fix, please send me a message.

1 Like

Note that if your git clone command contains a % sign (mine does), then your Windows command processor will treat it as the beginning of an environment variable name, thus misinterpreting the entire rest of the command.

In this case, you may need two % signs, or some other workaround.

1 Like