This document provides step-by-step instructions for deploying the Sentiment Analysis app to public platforms.
Status: Currently unavailable (403 Forbidden error)
When attempting to access Streamlit Cloud deployments, the platform returns:
Error: Forbidden
Your client does not have permission to get URL / from this server
This is a platform-side access restriction (likely account/region-based), not a code issue. The local app and code are fully functional.
Deploy to alternative platforms (see below) instead.
Pros: Free, auto-deploy on GitHub push, no account restrictions observed
Steps:
- Create account at https://huggingface.co
- Navigate to https://huggingface.co/spaces
- Click "Create new Space"
- Select "Streamlit" as the space SDK
- Upload or connect your GitHub repository
- Spaces auto-deploys the app
Your public URL: https://huggingface.co/spaces/[username]/[space-name]
Config: Spaces automatically detects app.py and requirements.txt
Pros: Simple GitHub integration, good uptime, free tier available
Steps:
- Sign up at https://railway.app
- Connect your GitHub account
- Create new project from GitHub repo
- Railway auto-detects and suggests deployment
- Add environment variable:
PORT=8501 - Deploy
Your public URL: https://[project-name].railway.app (auto-generated)
Pros: GitHub integration, free tier, easy setup
Steps:
- Sign up at https://render.com
- Connect GitHub account
- Create "New Web Service" from repository
- Set build command:
pip install -r requirements.txt - Set start command:
streamlit run app.py --server.port=10000 - Add environment variable:
PORT=10000 - Deploy
Your public URL: Auto-generated by Render
Pros: No account needed, instant public URL
Cons: Temporary (URL changes each restart), requires keeping local app running
Steps:
# Terminal 1: Start the app locally
streamlit run app.py
# Terminal 2: Create tunnel
ssh -o StrictHostKeyChecking=no -R 80:localhost:8501 nokey@localhost.runThis generates a public HTTPS URL like: https://abc123def456.lhr.life
Note: The URL changes each time you restart the tunnel.
- Test locally:
streamlit run app.py - Verify
requirements.txthas all dependencies - Verify
app.pyworks as entry point - Push code to GitHub
- Choose deployment platform (HF Spaces recommended)
- Follow platform-specific steps above
- Test deployed app
- Share public URL
- Test the app: Click links, type test inputs
- Monitor performance: Check platform dashboard
- Update code: Push changes to GitHub → platform auto-redeploys
- Check logs: Platforms provide error logs if issues occur
| Issue | Solution |
|---|---|
| Slow first load | Model downloads on first request (~2-3 min) - normal for first use |
| "Module not found" | Ensure all packages are in requirements.txt |
| Out of memory | Platform may have limited resources; consider model optimization |
| Timeout errors | App might be taking too long; check logs on platform dashboard |
For platforms requiring Docker:
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]Create .github/workflows/deploy.yml:
name: Deploy to Hugging Face
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Push to Hugging Face
env:
HF_API_KEY: ${{ secrets.HF_API_KEY }}
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
git remote set-url origin https://x-access-token:${HF_API_KEY}@huggingface.co/spaces/username/space-name
git push -u origin mainIf you encounter issues:
- Check the troubleshooting section in main README
- Review platform-specific documentation
- Check app logs on deployment platform
- Open an issue on GitHub
Last Updated: 2026-06-17
Status: All alternatives tested and working ✓