Open Sourcing the Anvil App Server

Anvil is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks – just build it all in Python.

Yes – Python that runs in the browser. Python that runs on the server. Python that builds your UI. A drag-and-drop UI editor. We even have a built-in Python database, in case you don’t have your own. It’s neat!

But once you’ve built your web app, you need to deploy it somewhere. You can deploy your app with us, of course, but sometimes you want to host it yourself. Perhaps you’re serving a remote medical facility without good Internet access. Perhaps you’re building an IoT device with your Raspberry Pi. Or perhaps you just want to be safe if a meteorite hits our datacentre, or if we get mugged by a passing gang of venture capitalists.

Good news! Now you can.

I build software for TV stations. When you’re on air, the show must go on – internet or no internet!

With the open-source App Server, I can build applications that don’t depend on an internet connection – which is great, because Anvil is the fastest tool I’ve ever encountered for development.

Michael Lavers

Consultant

What we’ve open-sourced

1. The Anvil Runtime

The Anvil Runtime, now available on GitHub, is the open-source engine that powers our hosting service. It serves your apps, launches and manages your server code, authenticates your users, renders your PDFs…all those good things. We have open-sourced it as a library (well, a set of libraries).

2. The Anvil App Server

The Anvil App Server, also now on GitHub, is a standalone server and the easiest way to host an Anvil app on your own computer.


How do I play with it?

I’m glad you asked! The Anvil App Server is available on PyPI, so you can create and serve a sample app with three commands:

$ pip install anvil-app-server
$ create-anvil-app todo-list MyTodoList
$ anvil-app-server --app MyTodoList

Of course, if you’ve already built an app with the Anvil Editor, you can check it out with Git and run it! Here’s a step-by-step guide: Getting Started with the Anvil App Server.

Within an hour of downloading the Anvil App Server, I was securely controlling devices around my home from a web app on my phone.

Joel Collins

Maintainer, LabThings

Wait, don’t I need to set up a database?

Nope! The App Server comes with Postgres built in, and by default will set up a new, private database in the .anvil-data/ directory.

What about HTTPS certificates?

Good question – security is important for any app on the public Internet! Fortunately, the App Server works with Let’s Encrypt, so all you need is:

$ anvil-app-server --app MyApp --origin https://mydomain.example.com

…and we’ll do the rest.

How do I contribute?

We are accepting pull requests on GitHub!

I have more questions.

I bet you do. Take a look at the README file in the source tree:


How do I build Anvil apps?

It’s pretty easy, actually – and our online editor is free to use! Start with our step-by-step tutorials, or check our our full-size example apps:

Finally: If you have any questions, or need a hand, please join us in the Anvil Community Forum! We look forward to meeting you there.