Honovel Honovel Deno

Deploying Honovel

Deploying a Honovel application is straightforward and optimized for modern cloud platforms. The framework is designed to work seamlessly with Deno Deploy, offering zero-config deployments with automatic scaling and global distribution.

Recommended Platform: Deno Deploy provides the best experience with instant deployments, automatic HTTPS, and global CDN.

Deploying to Deno Deploy

Deno Deploy is the official hosting platform for Deno applications, offering production-ready infrastructure with minimal configuration.

Step 1: Prepare Your Repository

Push your Honovel project to a Git hosting service:

# Initialize git (if not already done)
git init

# Add all files
git add .

# Commit your changes
git commit -m "Initial commit"

# Push to GitHub, GitLab, or Bitbucket
git remote add origin https://github.com/yourusername/your-app.git
git push -u origin main

Step 2: Create a Deno Deploy Project

  1. Visit Deno Deploy and sign in with your GitHub account
  2. Click "New Project"
  3. Select your repository from the list
  4. Important: Set the entrypoint to index.ts
  5. Choose your production branch (usually main or production)
  6. Click "Deploy Project"

Note: The index.ts file at your project root is the entry point for Honovel. Deno Deploy will automatically execute it.

Step 3: Configure Environment Variables

In the Deno Deploy dashboard, add your environment variables under Settings → Environment Variables:

Required Variables:

Variable Value Description
APP_ENV production Sets the application environment
APP_KEY (your generated key) Encryption key from deno task smelt key:generate
APP_URL https://your-app.deno.dev Your production URL
DB_CONNECTION mysql Database driver
DB_HOST your-db-host.com Database host
DB_DATABASE your_database Database name
DB_USERNAME your_username Database username
DB_PASSWORD your_password Database password (keep secret!)

Step 4: Run Migrations

After deployment, you may need to run migrations on your production database. You can do this locally:

# Set production database credentials in .env.production
deno task smelt migrate --db=production --force

Deployment Checklist

  • Ensure all routes and controllers are working locally
  • Generate a production APP_KEY using deno task smelt key:generate
  • Set all environment variables in Deno Deploy dashboard
  • Configure production database connection
  • Run database migrations
  • Test your application at the deployed URL
  • Set up custom domain (optional)

Continuous Deployment

Deno Deploy automatically redeploys your application whenever you push to your connected branch:

# Make changes to your code
git add .
git commit -m "Update feature"
git push

# Deno Deploy automatically rebuilds and deploys 🚀

Alternative Deployment Options

Self-Hosted with Docker

You can also deploy Honovel using Docker:

# Dockerfile
FROM denoland/deno:latest

WORKDIR /app

COPY . .

RUN deno cache index.ts

EXPOSE 8000

CMD ["deno", "run", "--allow-all", "index.ts"]
# Build and run
docker build -t honovel-app .
docker run -p 8000:8000 --env-file .env honovel-app

VPS Deployment

Deploy to any VPS (DigitalOcean, AWS, Linode, etc.):

# SSH into your server
ssh user@your-server.com

# Install Deno
curl -fsSL https://deno.land/install.sh | sh

# Clone your repository
git clone https://github.com/yourusername/your-app.git
cd your-app

# Set environment variables
nano .env

# Run migrations
deno task smelt migrate --force

# Start the server (use PM2 or systemd for production)
deno task smelt serve --port=80 --host=0.0.0.0

Performance Tips

  • Enable caching with deno task smelt optimize before deployment
  • Use a CDN for static assets
  • Configure database connection pooling
  • Enable gzip compression for responses
  • Use Deno Deploy's global edge network for low latency

Monitoring & Debugging

Monitor your deployed application:

  • View logs in the Deno Deploy dashboard
  • Set up error tracking (e.g., Sentry)
  • Monitor performance metrics
  • Use console.log() for debugging (visible in deployment logs)

Security Considerations

Production Security Checklist:

  • Never commit .env files to version control
  • Use strong, unique APP_KEY
  • Enable HTTPS (automatic with Deno Deploy)
  • Configure CORS properly
  • Use environment variables for all secrets
  • Enable CSRF protection for web routes
  • Set secure database credentials
  • Keep dependencies up to date

Summary

Deploying Honovel is designed to be simple and developer-friendly. With Deno Deploy, you get:

  • ✨ Zero-configuration deployments
  • 🌍 Global edge network
  • 🔒 Automatic HTTPS
  • ⚡ Fast cold starts
  • 📊 Built-in analytics and logging
  • 🔄 Automatic scaling

Your Honovel application is now ready for the world! 🚀