Skip to content
BotServBotServ
Instagram AutopilotHermes AgentPostizAI Social MediaAutomationSelf-HostingPractical Project

Instagram Autopilot with AI: Hermes Agent + Postiz

Build an AI agent that auto-creates Instagram posts: captions, hashtags, scheduling, publishing. Using Hermes Agent, Postiz, and self-hosted Ollama.

S

schutzgeist

4 min read
Instagram Autopilot with AI: Hermes Agent + Postiz

Project: Instagram Autopilot with AI: Hermes Agent + Self-Hosted Postiz

What This Project Does

An AI agent independently creates Instagram posts: writes captions, selects hashtags, prepares images, publishes at optimal times, and notifies you via Telegram about what happened. You provide only topics and images; everything else runs on autopilot.

The stack:

Hermes Agent (Brain, runs on VPS/Mini-PC)
    ├── Skill: Content Planning (weekly cron)
    ├── Skill: Captions + Hashtags (Ollama or API model)
    ├── Postiz Skill (Publishing API)
    │       └── Instagram Graph API → Post live
    └── Telegram Gateway (Reports + approvals to you)

Requirements: Instagram Business or Creator account, server or Mini-PC (Homelab guide), about 1 hour of setup.

Why This Architecture

  • Postiz instead of browser automation: Postiz uses the official Instagram Graph API, no risk from unauthorized automation, no account suspension danger like Selenium bots.
  • Hermes as the brain: It remembers what performed well (persistent memory) and improves captions over time, see Hermes Agent.
  • Local model optional: Captions can come from a local Ollama model, no per-post API costs.
  • Approval loop: The agent sends you a draft via Telegram; you reply “ok” or “change X”. You stay in control.

Step 1: Set Up Postiz

Postiz is the publishing layer, self-hosted or cloud. Details in the Postiz article.

# docker-compose.yml (excerpt)
services:
  postiz:
    image: ghcr.io/gitroomhq/postiz-app:latest
    ports: ["127.0.0.1:3000:5000"]
    environment:
      - DATABASE_URL=postgresql://postiz:pass@postgres:5432/postiz
      - REDIS_URL=redis://redis:6379
      - JWT_SECRET=zufaelliger-geheimer-string
    depends_on: [postgres, redis]

  postgres:
    image: postgres:17
    environment: [POSTGRES_PASSWORD=pass, POSTGRES_DB=postiz]
    volumes: [pg_data:/var/lib/postgresql/data]

  redis:
    image: redis:7-alpine

volumes:
  pg_data:

Then in the Postiz UI: connect your Instagram channel (Business account via Meta login), generate an API key.

Step 2: Install Hermes Agent + Skill

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
hermes model          # Choose model: local (Ollama) or API

# Install Postiz skill
npx skills add gitroomhq/postiz-agent
export POSTIZ_API_KEY=your_postiz_api_key

# Get Instagram integration ID
postiz integrations:list | jq '.[] | select(.identifier=="instagram")'

Step 3: The Weekly Cron: Plan Content Automatically

Hermes’ scheduler in natural language:

/message to Hermes:
"Every Sunday at 18:00: Create a content plan for the coming week
(3 posts: Monday/Wednesday/Friday at 18:00 each). Topics: local AI, Homelab,
Self-Hosting. Send me the plan for approval on Telegram."

Hermes sets up a cron job and sends you a draft each week. You reply “ok” → it schedules the posts via Postiz.

Step 4: Post What Actually Happens

# Internally: here's what the Postiz call looks like (the skill does this for you)
RESULT=$(postiz upload ./post-image.jpg)
IMAGE_URL=$(echo "$RESULT" | jq -r '.path')

postiz posts:create \
  -c "Homelab day 3: The switch arrived. 10G-SFP+ for the future. #homelab #selfhosted" \
  -m "$IMAGE_URL" \
  -s "2026-09-22T18:00:00Z" \
  --settings '{"post_type":"post"}' \
  -i "your-instagram-integration-id"

The key point: Instagram doesn’t allow text-only posts. The agent writes the caption, hook, and hashtags, but you provide the image (photo, screenshot, or generated via image generation skills like FLUX or Imagen). Full automation only works with an image source (your own photo folder or AI-generated graphics).

Step 5: Reports + Learning Loop

"Every Saturday: Send me a report on which posts performed,
reach, what worked, and suggestions for next week."

Hermes’ memory does the rest: it remembers that “behind the scenes” posts perform better than product photos and adjusts the next plan. This is what sets an agent apart from a rigid scheduler, because it learns.

Extensions

  • Multi-platform: Same caption → Postiz to LinkedIn, X, Facebook: Postiz supports roughly 15 networks.
  • Image pipeline: FLUX/Imagen locally via ComfyUI → Hermes generates graphics itself.
  • Comment management: Skill for replying to comments (careful: Meta rate limits).
  • Competitor research: Weekly research cron on competitor accounts.
  • Alternative without Hermes: Same flow works with n8n + Postiz node, less adaptive, but visual workflow.

What You’ll Learn

  • Agent skills system (agentskills.io)
  • Instagram Graph API via publishing tools
  • Cron automation in natural language
  • Approval workflows (Human-in-the-Loop)
  • Why API posting is not botting

Further Reading

Key Takeaways:

  • Instagram autopilot = Hermes Agent (brain) + Postiz (publishing) + image source.
  • Postiz uses the official Graph API, safe, no botting risk.
  • Text alone won’t work: Instagram needs an image or video; the agent handles the rest.
  • Human-in-the-loop: approval via Telegram, agent learns from performance.
  • About 1 hour setup on a VPS or Mini-PC; multi-platform extension is trivial.

FAQ

Yes, over the official Graph API (like Postiz uses it), that’s what it’s for. Browser automation (Selenium bots, auto-likers) is forbidden. A Business or Creator account is required for the API.

Completely without me?

Possible but not recommended. The agent needs an image source (photos folder or image generation) and an approval loop prevents embarrassing posts. “AI suggests, human approves” is the robust mode.

What does it cost?

Software: free (Hermes MIT, Postiz self-hosted). Model: Ollama locally is free or API costs (roughly 5-15 EUR/month for daily posts). Instagram: free.

Alternative without Hermes?

n8n with Postiz node + Ollama node, same flow as a visual workflow, but without memory or learning loop. That’s enough for rigid schedules; Hermes pays off for adaptive content strategy.

Where do the images come from?

Three ways: your own photo folder (agent picks), local image generation (FLUX/Imagen via ComfyUI), or screenshots and graphics you prepare. Text-only doesn’t work on Instagram.

Sources and Further Reading

Back to Blog
Share:

Related Posts