From this guide you will learn how to self-host a Streamlit app. We will create a simple app, commit it to Git and deploy your Streamlit app on your server.

1. Create a directory

Create create a directory for your app and switch to it

mkdir myapp
cd myapp

2. Python Virtual Environment

Create python virtual environment, activate it

python3 -m venv env
source env/bin/activate

3. Install streamlit

pip install streamlit

4. Steamlit Simple app

create a file with your app

import streamlit as st

def main():
    st.title("Deployed with Appliku")
    st.write("This app is deployed with Appliku")

if __name__ == "__main__":

5. Running Streamlit app locally

Make sure it works locally by running streamlit run

Console would say show this: image

App will open in your browser: image

6. requirements.txt for Streamlit app


7. How to run Streamlit app in production

Create a file We'll need this file to pass some arguments to the streamlit command when deploying the app

streamlit run --browser.serverAddress $SERVER_NAME --server.port $PORT

8. Push your Streamlit app to GitHub

Create initialize git and push to GitHub Now we need to initialize git repository, commit it and push to GitHub. First let's create a .gitignore file and put env there, to avoid accidentally committing our virtual environment:


Now run the following commands to initialize repo and make the first commit:

git init
git add .
git commit -m'Initial commit'
git remote add origin
git push -u origin master

When you create a repository on GitHub they will offer you a command to add a git remote url and push it to that repository. Use that URL, not the one from this example.



After you have pushed your code, you can refresh the page and see your files:


9. Deploy your Streamlit app to your server with Appliku

Go to Appliku dashboard Let's assume you already have an account and created a server.

If you do not have an account: please follow this link and create an account.

If you haven't added a server: please follow the instructions in the dashboard.

Create an application from GitHub repository. Give it a name. Select repository that we've just created. Select the branch master and your server. Click "Create application". image

Before. you hit deploy now, you need to go to Application settings. Find the "Environment Variables" tab. We need to add a variable SERVER_NAME, which will be passed to the command to run streamlit.

Appliku gives you a default domain which consists of the name of the app + "".

So if you named your app "myapp", then your site will be accessible on ""

Add a variable SERVER_NAME, the value of the variable should be your application's domain: "" (again: this is an example, adapt it to your application name). image


And you can click Save and Deploy.

In Application Settings, Processes tab add a process called web with command bash and click "Save and Deploy":


When deployment finishes: image

Go back to Application overview page and open the app.


Your Streamlit app is deployed!

10. Change Streamlit URL to a Custom Domain

To change URL of your streamlit application to be on a custom domain, in application settings go to the "Domains" tab.

In DNS settings for your domain make sure to point A record to the IP of your server.

Then add the domain to your app on the "Domains" tab. image

Then go to the "Environment variables" tab and edit the SERVER_NAME env var to the value of your custom domain like this: image

Click save and deploy.

If DNS propagation takes a while, adding the domain might fail, in this case remove and re-add the domain again.