Installation Guide
Follow these step-by-step instructions to set up Multi-Domain AutoBlogger on your system. This guide assumes you have basic knowledge of using a terminal/command line.
Prerequisites
Before you begin, ensure you have the following installed and configured:
1. Node.js 18 or Higher
Download and install Node.js from nodejs.org. Verify installation by running:
node --version
You should see version 18.0.0 or higher.
2. npm (Node Package Manager)
npm comes bundled with Node.js. Verify installation:
npm --version
3. PostgreSQL Database
You'll need a PostgreSQL database. Recommended options:
- Neon (Recommended): neon.tech - Serverless PostgreSQL
- Vercel Postgres: Integrated with Vercel hosting
- Supabase: supabase.com - Alternative PostgreSQL
- Any PostgreSQL Database: Works with any PostgreSQL 12+ database
4. Anthropic API Key (Required)
For AI content generation, you'll need an Anthropic API key:
- Sign up at console.anthropic.com
- Create an API key
- Copy the key for use in configuration
5. Optional: GoHighLevel Account
For email capture and CRM integration (optional):
- Sign up at gohighlevel.com
- Create a private integration with required scopes
- Get your Location ID and API Key
6. Optional: Google Analytics 4
For website analytics (optional):
- Create a GA4 property at analytics.google.com
- Get your Measurement ID (format: G-XXXXXXXXXX)
Step 1: Extract and Navigate to Project
- Extract the downloaded ZIP file to your desired location
- Open a terminal/command prompt
- Navigate to the project directory:
cd path/to/blogger
Step 2: Install Dependencies
Install all required Node.js packages:
npm install
This may take a few minutes. Wait for the installation to complete.
node_modules folder and package-lock.json file, then run npm install again.
Step 3: Configure Environment Variables
Create a file named .env.local in the root directory of the project. This file stores your configuration settings.
Create .env.local File
Create a new file called .env.local in the project root with the following content:
# Database Connection
DATABASE_URL=your_postgresql_connection_string_here
# AI Generation (Required)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Authentication
NEXTAUTH_SECRET=your_random_secret_string_here_minimum_32_characters
ADMIN_PASSWORD=your_admin_password_here
# Cron Job Authentication (Required for scheduled posts)
CRON_SECRET=your_secure_random_string_minimum_16_characters
# Multi-Domain Admin Access Control (Recommended)
# Set this to one of your domain names after adding domains in admin panel
# This domain will have full admin access (can manage all domains, themes, plugins)
# Other domains will have limited access (can only manage their own posts and categories)
MAIN_DOMAIN=your-main-domain.com
# Optional: Third-party Plugins
PLUGINS_JSON_URL=https://your-plugins-feed-url.com/plugins.json
Environment Variable Details
| Variable | Required | Description | Example |
|---|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string | postgresql://user:pass@host:5432/dbname |
ANTHROPIC_API_KEY |
Yes | Anthropic Claude API key for AI generation | sk-ant-api03-... |
NEXTAUTH_SECRET |
Yes | Random secret for session encryption (min 32 chars) | Generate with: openssl rand -base64 32 |
ADMIN_PASSWORD |
No | Default admin password (defaults to "admin123") | your_secure_password |
CRON_SECRET |
Yes | Secret for cron job authentication (min 16 chars) | Generate with: openssl rand -base64 16 |
MAIN_DOMAIN |
Recommended | Domain name with full admin access. Other domains have limited access (posts/categories only). Set this after adding domains in admin panel. | example.com |
PLUGINS_JSON_URL |
No | URL to third-party plugins JSON feed | https://example.com/plugins.json |
- The easiest way to get started is to run
npm run devlocally first to set up your database and create your first admin user. - After deploying to Vercel (or your hosting provider), add your domains through the admin panel.
- Set
MAIN_DOMAINto one of the domain names you added in the admin panel. - Re-deploy if you changed
MAIN_DOMAINafter initial deployment. - The domain specified in
MAIN_DOMAINwill have full administrative access (can manage all domains, themes, plugins). - Other domains will have limited access (can only manage their own posts and categories).
Generating Secure Secrets
To generate secure random strings for NEXTAUTH_SECRET and CRON_SECRET:
- On Mac/Linux: Run
openssl rand -base64 32in terminal - On Windows: Use an online random string generator or PowerShell
- Online: Use a secure random string generator (minimum 32 characters for NEXTAUTH_SECRET, 16 for CRON_SECRET)
Step 4: Set Up Database
4.1 Push Database Schema
Create all required database tables:
npm run db:push
This command creates all necessary tables in your PostgreSQL database.
4.2 Seed Initial Data
Create the default admin user:
npx tsx scripts/seed.ts
This creates an admin user with:
- Email:
admin@example.com - Password: Your
ADMIN_PASSWORDenv var, or "admin123" if not set
Step 5: Start Development Server
Start the development server to test your installation:
npm run dev
The server will start on http://localhost:3000
Step 6: Access Admin Panel
- Open your web browser
- Navigate to
http://localhost:3000/admin/login - Login with:
- Email:
admin@example.com - Password: Your
ADMIN_PASSWORDor "admin123"
- Email:
Step 7: Create Your First Domain
After logging in, create your first domain:
- Click on "Domains" in the admin navigation
- Click "New Domain" button
- Enter your domain name (e.g.,
example.com) - Configure basic settings:
- Select or create a theme
- Add site title and description
- Configure SEO settings
- Click "Save"
localhost:3000 or add entries to your /etc/hosts file (Mac/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows) to test with custom domains.
Production Deployment
For production deployment, we recommend using Vercel:
Deploy to Vercel
- Push your code to a GitHub repository
- Go to vercel.com and sign in
- Click "New Project"
- Import your GitHub repository
- Configure environment variables in Vercel dashboard:
- Add all variables from your
.env.localfile - Ensure
CRON_SECRETis set for scheduled posts
- Add all variables from your
- Click "Deploy"
- After deployment completes:
- Add your custom domains in Vercel project settings
- Configure DNS records as instructed by Vercel
- Add your domains through the admin panel (Admin > Domains)
- Set the
MAIN_DOMAINenvironment variable in Vercel to one of your domain names - Re-deploy if you changed
MAIN_DOMAINafter initial deployment
- Start with local development (
npm run dev) to set up your database and create your first admin user - Deploy to Vercel (or your hosting provider) with all environment variables configured
- After deployment, add your domains through the admin panel
- Set
MAIN_DOMAINenvironment variable to one of your domain names (the one you want to have full admin access) - Re-deploy if you changed
MAIN_DOMAINafter initial deployment
Build for Production
To test the production build locally:
npm run build
npm start
Troubleshooting
Database Connection Errors
- Verify your
DATABASE_URLis correct - Ensure your database server is running and accessible
- Check firewall settings if using a remote database
- Verify database credentials are correct
API Key Errors
- Verify your
ANTHROPIC_API_KEYis correct and active - Check your Anthropic account has sufficient credits
- Ensure the API key has proper permissions
Port Already in Use
If port 3000 is already in use:
- Stop the other application using port 3000, or
- Set a custom port:
PORT=3001 npm run dev
Module Not Found Errors
- Delete
node_modulesfolder andpackage-lock.json - Run
npm installagain - Ensure you're using Node.js 18 or higher
Next Steps
Now that installation is complete, you can: