PySaaS
  • ๐Ÿ‘‹Introduction
  • ๐ŸšงInstallation and Setup
    • ๐Ÿง Installation
    • ๐Ÿ‘ฏUser Authentication - Firebase
    • ๐Ÿ‘ฏUser Authentication - Supabase
    • ๐Ÿ’ฐSubscriptions - Lemon Squeezy
    • ๐Ÿ’ปBlog CMS - Notion
    • ๐Ÿ“ŠGoogle Analytics
    • ๐ŸงชTesting
  • ๐Ÿš—Deployment
    • Hosting Options
    • Generalized Instructions
  • โ‰๏ธTroubleshooting
    • ๐Ÿ”ฅFirebase Setup
    • Firebase - Setting up Custom Domain for Emails
    • Firebase - Customizing Reset Emails
    • ๐Ÿ‹Lemon Squeezy Setup
    • โ†”๏ธNGROK Setup
    • ๐Ÿ’ปNotion Setup
    • โฌ†๏ธUpdating Project from Pynecone to Reflex
Powered by GitBook
On this page
  • Self Hosting
  • Create a VM
  • Environment Setup
  • Clone Your Code
  • Set API URL
  • Run Your App

Deployment

Easily Self Host Your Application

PreviousTestingNextHosting Options

Last updated 1 year ago

Self Hosting

Hosting Options - Digital Ocean

You can use any cloud provider to host your application. In this guide, we'll show you how to deploy with . If you use the provided link, you will get a free $200 credit for your account.

Hosting Options - Colohouse

Another option for hosting is VPS Cloud Servers. Their plans start at just $6.99 per month for a basic VPS and services range from there.

If you'll need a higher-end server for a more serious application, a is a great place to look.

Hosting Option - Interserver

use the code PENNYDEAL to get your first month for only $0.01!

Create a VM

After you sign in or make an account, create an Ubuntu 20 VM (Droplet) in the region closest to your users. If you're just starting, the Regular CPU option is fine.

Environment Setup

You should now have an IP address after creating an Ubuntu VM. SSH into your VM to get set up with requirements.

ssh root@<IP>
apt-get update
apt install python3-pip nodejs zip

Clone Your Code

You can now clone your repository and install the necessary requirements. As an example, we'll clone the PySaaS boilerplate and assume you've set up your environment variables on your VM.

git clone https://github.com/getpysaas/pysaas.git
cd pysaas
pip install -r requirements.txt

Set API URL

Match the api_url parameter in rxconfig.py to your IP address:

import reflex as rx

config = rx.Config(
    app_name="pysaas",
    api_url="http://<IP>:8000",
    db_url="sqlite:///reflex.db",
    env=rx.Env.DEV,
)

Run Your App

Run a test in development mode to make sure everything works as expected.

reflex init
reflex run --port 80

To run in production mode and create an optimized build of your app, run:

reflex run --env prod --port 80

You should now be able to see the app live by typing your IP address into your browser. Now, if you'd like, get a custom domain and point it to your IP address!

The links above can contain affiliate links to services. By using these links, it helps support PySaaS development even more and doesn't cost you a dime extra!

๐Ÿš—
DigitalOcean
Colohouse
dedicated enterprise server from Colohouse
Interserver
DigitalOcean Referral Badge