Introduction
This phase covers deploying your completed local store to a production server.
No building, migrating, or configuring happens on the server. Production simply runs what you have already built locally.
Step 1: Prepare the Production Server
Ensure your server has:
-
Python installed
-
a user account for deployment
-
your project directory created (e.g. /home/user/ebuilder)
-
a virtual environment set up
No database setup is required on the server.
Step 2: Upload Application Files
Upload the application code from your local machine to the server. You may use:
-
SCP
-
SFTP (FileZilla / WinSCP)
-
rsync
Upload everything except:
-
local virtual environment (venv/)
-
local cache files
-
staticfiles folder
Step 3: Upload the Database
Upload the SQLite database file:
db.sqlite3
Place it in the project root on the server. This file contains:
-
users
-
products
-
orders
-
pages
-
settings
-
admin accounts
No migrations are run on production.
Step 4: Upload Media Files
Upload the media/ directory from your local project to the server.
This includes:
-
product images
-
downloadable files
-
uploaded assets
Ensure file permissions allow the application to read the files.
Step 5: Install Dependencies on Production
On the server:
cd /home/user/ebuilder
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Dependencies must match the local environment.
Step 6: Upload Environment Variables
Upload your configured .env file.
This file should:
-
contain production domain values
-
use Stripe keys (you can keep them in test mode if you want to test in production)
-
use production email settings
Step 7: Collect Static Files
source venv/bin/activate
python manage.py collectstatic --no-input
This command must be run on the production server. Do not upload staticfiles/ from local development.
Output of Phase 3
At the end of this phase, the application is running on the server and responding on its internal port (for example localhost:8000). The site is not yet accessible from the internet. Proceed to Phase 4 to configure your domain, HTTPS, and public access using Caddy.
Final Phase
Proceed to:
Phase 4: Server & Domain Configuration
(DNS, HTTPS, reverse proxy, SSL verification)
At the end of this phase your site will be live.