Auto-DM Instagram Comments
Self-host OpenReply to send Instagram comment keywords as private DMs.
Introduction
30 Second Summary
Comments on Instagram can turn into a pile of repeated questions when everyone wants the same link. Replying to each person by hand gets old fast.
In this project, you will deploy your own OpenReply dashboard that turns a `LINK` comment into a link sent by DM. You will use Claude Code to configure the existing app for your Instagram account through Meta's official API.
What You'll Build
Your demo ends with a second Instagram account receiving your chosen link by DM while OpenReply records the result as `SENT`.
By the end of this project, you'll have:
- A public OpenReply dashboard you can sign into with a magic link at your own vercel.app address.
- A live campaign using whole-word matching for LINK on one selected post or reel. A comment such as link please! triggers your chosen link without matching links.
- A complete comment-to-DM demo where your second account receives the link while DM Logs records SENT.
- Secret Mission: move only the worker to Railway so auto-DMs keep sending while your computer is off.
Are there any prerequisites?
You'll need a Claude plan that includes Claude Code, a Facebook account, two Instagram accounts, permission to switch the main one to professional, and a computer running macOS 13 or newer or Windows 10 1809 or newer. No coding experience is required.
Before We Start
Before the hands-on setup begins, this step locks in the destination link and Instagram post or reel that give your campaign a clear purpose.
Get OpenReply onto Your Computer
OpenReply's cloud services cannot help until Claude Code has a trusted local copy to inspect and operate.
Node.js runs the project's JavaScript tools on your computer. The native installers prepare both tools without Docker or Homebrew.
In this step, get ready to:
- Install Claude Code and Node.js 24 LTS. Claude Code prints a version number. Node.js reports a version beginning with v24.
- Create a personal GitHub fork of the pinned OpenReply repository. Its extracted files are available in Downloads.
- Install OpenReply's dependencies through Claude Code. Claude Code explains the web app and the separate worker process.
Prepare the local toolchain
Claude Code uses a native installer for each supported platform. The installer adds the command that you use from a terminal.
macOS
- Install Claude Code through its native macOS installer by running this command:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?
This command downloads the official Claude Code installation script. It passes that script to your shell so the native installer can run.
You should see the installer finish without reporting an installation error.
Windows
- Install Claude Code through its native Windows installer by running this command:
irm https://claude.ai/install.ps1 | iex
What does this command do?
This command retrieves the official Claude Code PowerShell installation script. It passes that script to PowerShell so the native installer can run.
You should see the installer finish without reporting an installation error.
OpenReply depends on the Node.js runtime for its setup commands. The LTS release gives the project the 24 series required for this setup.
- Open the official Node.js download page.
- Select the Node.js 24 LTS installer for your computer.
- Use the operating-system options on the download page to choose the installer for macOS or Windows.
- Complete the Node.js installer using its default options.
- Open the installer from your Downloads folder.
- Follow each on-screen prompt until the installation finishes.
You should see the Node.js installer confirm that the installation is complete.
The version checks confirm that your terminal can find both tools. They also catch an older Node.js installation before it causes confusing dependency errors.
macOS
- Check both installed tools by running these commands:
claude --version
node --version
What do these commands do?
- The first command asks Claude Code to print its installed version.
- The second command asks Node.js to print its installed version.
Claude Code should print a version number. Node.js should print a version beginning with v24.
Windows
- Check both installed tools by running these commands:
claude --version
node --version
What do these commands do?
- The first command asks Claude Code to print its installed version.
- The second command asks Node.js to print its installed version.
Claude Code should print a version number. Node.js should print a version beginning with v24.
✔️ I see the expected versions
Your local tools have cleared their first checkpoint. Claude Code responds from the terminal. Node.js reports the required v24 series.
ⓧ I see an older Node.js version
- Return to the official Node.js download page.
- Install Node.js 24 LTS again.
- Check the active Node.js version by running this command:
node --version
What does this command do?
This command prints the Node.js version that your current terminal session can access.
You should now see a version beginning with v24.
ⓧ Node command not found
- Close the current terminal window.
- Press Cmd+Space on macOS or the Windows key on Windows to open system search.
- Type Terminal on macOS or PowerShell on Windows.
- Press Enter to open a new terminal.
- Check Node.js again by running this command:
node --version
What does this command do?
A new terminal reloads the command locations updated by the installer. This command checks whether Node.js is now available.
- Return to the official Node.js download page if the command is still unavailable.
- Reinstall Node.js 24 LTS using the official installer.
After reinstalling, a new terminal should report a version beginning with v24.
Bring OpenReply into Claude Code
A fork gives you a personal copy of the OpenReply repository under your own GitHub account. The pinned project state keeps this walkthrough aligned with commit c78b2d2f68c9764ef7a7dde51dfa5bfa99304a09.
- Open the pinned OpenReply repository.
- Create a GitHub account if you do not already have one.
- Use GitHub's on-screen account flow if it asks you to register.
- Return to the pinned OpenReply repository after registration.
- Create a personal fork of the pinned repository.
- Choose Fork in the repository header.
- Complete GitHub's fork form using your account as the owner.
You should see an OpenReply repository under your own GitHub account.
- Download your personal OpenReply fork as a ZIP archive.
- Open your personal fork's repository page.
- Open the repository's download menu.
- Choose the ZIP download option.
Your browser should save the OpenReply ZIP archive in Downloads.
macOS
- Extract the downloaded archive so the repository is available at ~/Downloads/openreply-main.
- Press Cmd+Space to open system search.
- Type Finder.
- Press Enter to open Finder.
- Select Downloads in the Finder sidebar.
- Open the downloaded OpenReply ZIP archive to extract it.
You should see the openreply-main folder in Downloads.
Windows
- Extract the downloaded archive so the repository is available at $HOME\Downloads\openreply-main\openreply-main.
- Press the Windows key to open system search.
- Type File Explorer.
- Press Enter to open File Explorer.
- Select Downloads in the File Explorer sidebar.
- Use the archive extraction option to extract the downloaded OpenReply ZIP archive.
You should see the extracted repository at $HOME\Downloads\openreply-main\openreply-main.
Starting Claude Code from the repository folder gives it access to OpenReply's local documentation. Claude Code asks you to trust the folder before showing its prompt.
macOS
- Enter the extracted OpenReply folder and start Claude Code by running these commands:
cd ~/Downloads/openreply-main
claude
What do these commands do?
- The first command moves your terminal into the extracted OpenReply folder.
- The second command starts Claude Code with that folder as its project context.
Claude Code should ask whether you trust the OpenReply folder.
Windows
- Enter the extracted OpenReply folder and start Claude Code by running these commands:
cd $HOME\Downloads\openreply-main\openreply-main
claude
What do these commands do?
- The first command moves PowerShell into the extracted OpenReply folder.
- The second command starts Claude Code with that folder as its project context.
Claude Code should ask whether you trust the OpenReply folder.
- Confirm that you trust the local OpenReply folder when Claude Code asks.
You should see the Claude Code prompt with the local OpenReply folder loaded.
Let Claude Code inspect the project
OpenReply includes setup and architecture documents for its own source code. Claude Code can read those files before it installs anything, which keeps its actions grounded in the pinned repository.
Before you send the request, do you expect the dependency installation to finish with or without an ERR! line?
- Ask Claude Code to explain the project and install its dependencies by sending this exact request:
Read README.md, docs/setup.md, docs/stack.md, and package.json. I am a total beginner on [[OPERATING_SYSTEM="Mac or Windows"]]. Use only this free main path: Vercel for the web app, Neon for Postgres, Redis Cloud for Redis, Resend's test sender for email, my own Meta app with no Zernio, and the worker on my computer. Explain the web app and worker in plain words. Then run npm install. Do not use Docker, Homebrew, or openssl. If a command fails, explain the error before changing anything.
What does this prompt do?
- The document list tells Claude Code which repository files define the supported setup.
- The free main path keeps the web app on Vercel. It keeps the long-running worker on your computer.
- The final instruction asks Claude Code to explain failures before it changes the project.
The first dependency installation can take a few minutes while packages download. A quiet pause between updates is normal.
Claude Code should explain that the web app serves the dashboard and receives requests. It should explain that the separate worker processes queued DM jobs. The installation should finish without an ERR! line.
Dependency installation did not finish?
Open a new terminal after installing Node.js. Return to the extracted OpenReply folder before starting Claude Code again.
If the terminal still cannot find Node.js, reinstall Node.js 24 LTS from the official installer.
Still stuck? Help me understand the first installation error.
Your trusted OpenReply copy is ready for the services that make it work. Next, you will connect its shared database, queue, and sign-in email service.
Connect Data and Email Services
Your local OpenReply copy is ready. Claude Code can now connect it to the services that hold campaign data and deliver sign-in emails.
OpenReply needs shared storage plus a queue to remember campaigns and hand DM jobs to the worker process.
In this step, get ready to:
- Complete .env with the Neon, Redis Cloud, and Resend settings.
- Apply OpenReply's database setup through Prisma.
- Run OpenReply locally until its sign-in page loads.
Create the PostgreSQL and Redis services
Neon stores OpenReply's campaign data in PostgreSQL. Redis Cloud holds the queued jobs that BullMQ passes to the worker.
- Create your Neon account from the Neon website.
- Create a PostgreSQL project on the Free plan.
- Use the project creation control in the Neon dashboard.
- Select the Free plan during the project setup flow.
- Copy the PostgreSQL connection string that Neon presents for application access.
- Use the connection details panel for the project you just created.
- Keep the selected connection string visible until OpenReply starts successfully.
You should now have a Neon Free project plus its PostgreSQL connection string.
- Create your Redis Cloud account from the Redis Cloud website.
- Create a Free 30 MB Essentials database.
- Start the database creation flow from the Redis Cloud dashboard.
- Choose the Free 30 MB Essentials option.
- Copy the native TCP connection details shown by Redis Cloud.
- Use the connection wizard for the database you just created.
- Locate the default username, password, host, and port.
You should now have the values needed to build REDIS_URL in the form redis://default:PASSWORD@HOST:PORT.
Why does Redis need native TCP?
BullMQ relies on Redis commands that HTTP or REST endpoints do not provide. The native TCP endpoint gives OpenReply the queue behavior its worker expects.
- Paste this request into the Claude Code session from earlier:
Create .env from .env.example. Set DATABASE_URL to [paste the Neon connection string]. Set REDIS_URL to redis://default:[paste password]@[paste host]:[paste port]. Confirm the variable names and mask the secret values. Do not print full credentials and do not commit .env.
What does this request do?
- Claude Code creates the local .env file from OpenReply's example.
- DATABASE_URL points OpenReply to the Neon PostgreSQL project.
- REDIS_URL points OpenReply to the native Redis Cloud endpoint.
- The final instructions protect the credentials from terminal output and Git commits.
- Fill every placeholder in the request with its matching Neon or Redis Cloud value.
- Send the completed request to Claude Code.
That shared data layer is now in place. Claude Code should confirm DATABASE_URL plus REDIS_URL without exposing either credential.
Configure Resend's test sender
Resend sends the magic link used to enter the OpenReply dashboard. Its test sender can deliver only to the email address associated with your Resend account.
- Open the Resend website.
- Create your Resend account with the exact email address you plan to use for OpenReply sign-in.
- Use the account creation control on the Resend landing page.
- Complete the account flow with your chosen OpenReply sign-in email.
The next value is a live credential. Claude Code masks it so the full key stays out of its reply.
- Create a Resend API key for OpenReply.
- Use the API key section in your Resend account.
- Complete the key creation flow for this OpenReply project.
- Copy the new API key for the next request.
- Paste this request into Claude Code:
Update .env. Set EMAIL_FROM to OpenReply <onboarding@resend.dev>, ALLOWED_EMAILS to [the exact email used for my Resend account], and RESEND_API_KEY to [paste the API key]. Confirm the three variable names, mask the key, and do not commit .env.
What does this request do?
- EMAIL_FROM uses the verified test sender OpenReply <onboarding@resend.dev>.
- ALLOWED_EMAILS limits dashboard sign-in to your chosen email.
- RESEND_API_KEY authorizes OpenReply to ask Resend for the magic-link email.
- Fill every placeholder with the matching Resend account value.
- Send the completed request to Claude Code.
You should see confirmation for EMAIL_FROM, ALLOWED_EMAILS, and RESEND_API_KEY. The API key should remain masked.
Generate secrets and start OpenReply
OpenReply now has its external services. It still needs internal secrets plus database tables before the sign-in page can run.
- Paste this request into Claude Code:
Use Node's crypto module, not openssl, to generate NEXTAUTH_SECRET, CRON_SECRET, WEBHOOK_VERIFY_TOKEN, and a 64-character hexadecimal ENCRYPTION_KEY. Save them in .env. Keep META_GRAPH_API_VERSION from .env.example. Then run npm run db:generate, npm run db:migrate, and npm run dev. Explain any error in beginner language. Tell me when I can visit http://localhost:3000.
What does this request do?
- Node's crypto module generates the four internal secrets required by OpenReply.
- ENCRYPTION_KEY receives the exact 64-character hexadecimal format required by the app.
- npm run db:generate prepares the Prisma client used by OpenReply.
- npm run db:migrate applies OpenReply's database migrations to Neon.
- npm run dev starts the local web app.
The first start can pause while Prisma prepares the client and applies migrations. Continued terminal output means the setup is still moving.
- Send the request to Claude Code.
Claude Code should confirm that ENCRYPTION_KEY contains exactly 64 hexadecimal characters. It should also report that the migration completed and the development server started.
Before you open the local address, what page do you expect OpenReply to show?
- Visit http://localhost:3000 in your browser.
You should see the OpenReply sign-in page. The terminal should keep npm run dev running while the page remains available.
Local sign-in page missing?
- Ask Claude Code to regenerate ENCRYPTION_KEY if it reports that the value is not exactly 64 hexadecimal characters.
- Return to Redis Cloud for native TCP details if the Redis error mentions HTTP or REST.
Still stuck? Help me diagnose why OpenReply is not loading at localhost.
Your local dashboard now has working data, queue, and email services. Next, you can give it a public HTTPS address.
Deploy the Dashboard to Vercel
Your local OpenReply sign-in page proves that the dashboard can start with your database, queue, and email settings. Now you are giving that same dashboard a public home.
Meta for Developers needs a public HTTPS address before it can reach OpenReply later.
Vercel publishes the web app with its shared environment variables. The final health check reveals which OpenReply process still needs its own runtime.
In this step, get ready to:
- Deploy your OpenReply fork until Vercel reports Ready at a public HTTPS address.
- Align the hosted settings with your local setup by adding NEXTAUTH_URL in both places.
- Sign in by magic link and inspect the health response to identify the remaining unhealthy process.
Import the GitHub fork
Vercel connects to your GitHub fork and runs OpenReply's vercel-build script. That script generates Prisma, applies the database migrations, and builds the Next.js web app.
- Open the Vercel website.
- Create your Vercel account with GitHub on the Hobby plan.
- Select GitHub as the sign-up method on Vercel's account page.
- Approve access to your personal OpenReply fork when GitHub asks for authorization.
You should see the Vercel dashboard after the authorization finishes.
- Import your personal OpenReply fork into a Vercel Hobby project.
- Choose Add New in the Vercel dashboard.
- Choose Project.
- Select your personal OpenReply fork from the repository list.
- Continue to the project configuration screen.
You should see the OpenReply project configuration screen before the first deployment begins.
This screen handles private credentials, so take your time with each value.
- Add these existing local values under Environment Variables: DATABASE_URL, REDIS_URL, EMAIL_FROM, ALLOWED_EMAILS, RESEND_API_KEY, NEXTAUTH_SECRET, CRON_SECRET, WEBHOOK_VERIFY_TOKEN, ENCRYPTION_KEY, and META_GRAPH_API_VERSION.
- Expand Environment Variables on the project configuration screen.
- Create one entry for each listed variable name.
- Paste each matching value directly from the local .env file.
- Keep every secret value hidden while you copy it.
You should see ten environment variable entries configured for the project. The Meta app credential variables remain absent because those values do not exist yet.
The first cloud build can take several minutes, so a quiet progress screen is normal.
- Deploy the project on the Hobby plan.
- Review the selected repository on the configuration screen.
- Choose Deploy to start the build.
You should see the deployment status reach Ready. Vercel assigns a public address ending in vercel.app.
- Record the assigned HTTPS address here: https://YOUR-APP.vercel.app.
- Find the public address on the successful deployment page.
- Copy the complete address beginning with https://.
Your first public deployment is live. The dashboard now has the address that later integrations can reach.
Build did not reach Ready?
Start with the first actionable error in the Vercel build log. Later messages often describe effects of that first failure.
- Copy the build log into Claude Code without including secret environment values.
- Ask Claude Code to explain the first real error in beginner language.
- Apply only the smallest safe fix that Claude Code recommends.
Still stuck? Help me identify the first actionable Vercel build error.
Set the public address
NEXTAUTH_URL tells OpenReply which public address belongs to the deployed app. The hosted project and local worker need the exact same address so they operate as one setup.
- Set NEXTAUTH_URL in Vercel to https://YOUR-APP.vercel.app.
- Return to the environment variable settings for your OpenReply project.
- Create an entry named NEXTAUTH_URL.
- Paste the exact HTTPS address you recorded.
- Save the new environment variable.
You should see NEXTAUTH_URL in the project's environment variable list with its value protected.
- Redeploy the Vercel project with the updated environment settings.
- Return to the latest deployment for your OpenReply project.
- Choose the option to redeploy that deployment.
- Confirm the redeployment when Vercel asks.
You should see the new deployment reach Ready at the same public address.
- Update the local .env by switching back to the Claude Code session from earlier and pasting this request:
Set NEXTAUTH_URL in my local .env to [[VERCEL_URL="https://YOUR-APP.vercel.app"]]. Check that DATABASE_URL, REDIS_URL, ENCRYPTION_KEY, and NEXTAUTH_URL now match the values used by the Vercel web app. Mask secrets in your reply.
What does this request do?
- Claude Code adds the public address to your local .env file.
- The comparison checks that the hosted web app and future local worker use the same database, queue, encryption key, and public address.
- Masking keeps the secret values out of Claude Code's reply.
Claude Code should confirm that DATABASE_URL, REDIS_URL, ENCRYPTION_KEY, and NEXTAUTH_URL match without printing their full values.
Sign in and inspect the health check
Resend's test sender delivers only to the email address associated with your Resend account. Your existing ALLOWED_EMAILS value uses that same address, so the public dashboard can send your magic link.
- Visit https://YOUR-APP.vercel.app.
You should see the public OpenReply sign-in page.
- Sign in with the exact Resend-account email saved in ALLOWED_EMAILS by using a magic link.
- Enter the exact Resend-account email on the OpenReply sign-in page.
- Choose Email me a magic link.
- Return to the inbox for that email address.
- Follow the new OpenReply magic link from the inbox.
You should see the OpenReply dashboard open at your public Vercel address.
Magic link missing?
- Check the spam folder for the OpenReply email.
- Confirm the sign-in address exactly matches the email saved in ALLOWED_EMAILS.
- Confirm the same address belongs to your Resend account.
Need help? Help me troubleshoot my missing OpenReply magic link.
Before you open the health check, pause and predict which OpenReply services you expect to report healthy.
- Open the public health check by visiting this address:
[[VERCEL_URL="https://YOUR-APP.vercel.app"]]/api/health
What does this address check?
- The /api/health endpoint checks the database connection.
- It also checks Redis, the queue, and the worker heartbeat.
- These checks separate a healthy web deployment from the long-running process that sends queued DMs.
You should see the database and Redis reported as healthy. The worker is reported as unhealthy because no long-running worker is running yet.
That worker failure is the intended result. Your public web app is working, and the health check has exposed the exact gap the later worker step closes.
Your dashboard is public and accepts magic-link sign-ins. Next, you'll authorize it to work with your Instagram professional account through your own Meta app.
Create and Publish Your Meta App
Your OpenReply dashboard is already live on Vercel. Now you will give it permission to work with your professional account.
A public dashboard cannot read Instagram comments or send replies until a Meta for Developers app authorizes it through OAuth.
In this step, get ready to:
- Prepare your Instagram professional account. Its tester role is accepted on your Meta app.
- Register OpenReply's public addresses. Its Meta credentials are saved locally and in Vercel.
- Publish your Meta app. Its dashboard shows a published or Live status.
Prepare your Instagram account and app role
Meta's Instagram Platform works with professional Creator or Business accounts. An app role lets your account use the app through Standard Access while you build and test.
- Switch your main Instagram account to a professional Creator or Business account if it is currently personal.
- In the Instagram app, return to your main account's settings.
- Follow Instagram's current account-type flow.
- Choose Creator or Business.
You should see your main account identified as a professional Creator or Business account.
- Open Meta for Developers.
You should see the Meta app dashboard or a prompt to complete developer registration.
- Sign in with the Facebook account you use for Meta developer registration.
- Use the sign-in option on the Meta for Developers page.
You should see your developer account area.
- Complete Meta's developer registration if prompted.
- Follow each registration prompt using your own account details.
You should return to the app dashboard after registration.
- Create a Meta app for this OpenReply deployment.
- Use the app creation control in the Meta app dashboard.
- Follow the current prompts to create the app.
You should see the new app in your Meta app dashboard.
- Select the Instagram messaging and content use case described by OpenReply.
- Review the current use-case list during app creation.
- Choose the option that covers Instagram messaging and content.
You should see Instagram API setup options inside the app.
- Add your main Instagram username as an Instagram tester.
- Open the app's Instagram role or tester area.
- Use the tester control to enter your main Instagram username.
You should see the Instagram account listed with a pending tester invitation.
- Accept the tester invitation from your main Instagram account.
- Return to your main account in the Instagram app.
- Open the current app permissions area.
- Find the pending tester invitation.
- Accept the invitation.
You should see the tester role accepted for your main Instagram account.
Seeing an insufficient role error?
The message Insufficient Developer Role usually means the Instagram tester invitation is still pending.
Return to the invitation inside Instagram. Confirm that your main account accepted it.
Still blocked? Help me check my Instagram tester role.
Register OpenReply's addresses and save the app credentials
The OAuth redirect sends the learner back to OpenReply after authorization. The webhook callback gives Meta an HTTPS endpoint for comment notifications.
- Register your exact Vercel address with /api/instagram/callback appended as the OAuth redirect URI.
- In the app's Instagram API setup, locate the OAuth redirect URI area.
- Add the redirect address to the URI list.
You should see a saved URI in this format: https://YOUR-APP.vercel.app/api/instagram/callback.
- Register your exact Vercel address with /api/webhook appended as the webhook callback URL.
- Locate the webhook setup area in the Instagram API settings.
- Enter the address in the Callback URL field.
You should see a callback URL in this format: https://YOUR-APP.vercel.app/api/webhook.
- Set the webhook verify token to the existing WEBHOOK_VERIFY_TOKEN value from your local .env file.
- Use the Verify token field beside the callback URL.
- Paste the unchanged token value from your local environment.
You should see the callback accepted or verified by Meta.
- Select the comments webhook field if Meta permits the subscription.
- Open the available webhook fields for the Instagram subscription.
- Enable comments if it is available for your app.
You should see comments selected when your app's access level permits it.
What if comments cannot be selected?
Meta's webhook guide requires Advanced Access for comments notifications. OpenReply's pinned guide also documents a tester-account path using Standard Access for accounts with an app role.
Continue if Meta does not permit the subscription. The worker checks for missed comments every five minutes.
The next values are credentials that authorize OpenReply. Keep them private while Claude Code masks them in its reply.
- Copy the Instagram app ID from your Meta app.
- Use the app credentials area to locate the Instagram app ID.
- Copy the Instagram app secret from your Meta app.
- Use the app credentials area to reveal the Instagram app secret.
- Copy the Meta app secret from your Meta app.
- Use the app credentials area to reveal the Meta app secret.
- Update your local .env by replacing the three plain placeholders in this Claude Code request before pasting it:
Update my local .env with INSTAGRAM_APP_ID=paste-instagram-app-id-here, INSTAGRAM_APP_SECRET=paste-instagram-app-secret-here, and FACEBOOK_APP_SECRET=paste-facebook-app-secret-here. Keep WEBHOOK_VERIFY_TOKEN unchanged. Confirm the four variable names, mask every value, and remind me to add the three new Meta values to Vercel before redeploying.
What does this request do?
- The request adds INSTAGRAM_APP_ID to your local environment.
- It stores INSTAGRAM_APP_SECRET without printing the full value.
- It stores FACEBOOK_APP_SECRET without printing the full value.
- It preserves the existing WEBHOOK_VERIFY_TOKEN used during callback verification.
Claude Code should confirm all four variable names. Every credential value should remain masked.
- Add INSTAGRAM_APP_ID to your Vercel project with the matching Instagram app ID.
- Return to the OpenReply project in Vercel.
- Select Settings.
- Select Environment Variables.
- Use the add-variable form for this entry.
You should see INSTAGRAM_APP_ID in the environment variable list.
- Add INSTAGRAM_APP_SECRET to your Vercel project with the matching Instagram app secret.
- In Environment Variables, use the add-variable form for this entry.
You should see INSTAGRAM_APP_SECRET listed with its value protected.
- Add FACEBOOK_APP_SECRET to your Vercel project with the matching Meta app secret.
- In Environment Variables, use the add-variable form for this entry.
You should see FACEBOOK_APP_SECRET listed with its value protected.
- Confirm that the existing WEBHOOK_VERIFY_TOKEN remains configured in Vercel.
- Use the search or variable list in Environment Variables to locate the entry.
You should see WEBHOOK_VERIFY_TOKEN without exposing its full value.
- Redeploy the OpenReply project with the updated environment variables.
- Return to the project's deployment area.
- Use the current deployment's redeploy control.
The deployment should return to Ready with the three new Meta variables available.
Add the legal pages and publish the app
Meta needs public legal pages before an app can move into its published state. OpenReply already serves the required pages from your Vercel deployment.
- Set the app's privacy URL to your exact Vercel address with /privacy appended.
- In the app's legal or publishing settings, locate the Privacy field.
- Enter the deployed OpenReply privacy-page address.
You should see a privacy URL in this format: https://YOUR-APP.vercel.app/privacy.
- Set the app's terms URL to your exact Vercel address with /terms appended.
- In the legal or publishing settings, locate the Terms field.
- Enter the deployed OpenReply terms-page address.
You should see a terms URL in this format: https://YOUR-APP.vercel.app/terms.
- Set the app's data-deletion URL to your exact Vercel address with /data-deletion appended.
- In the legal or publishing settings, locate the data-deletion field.
- Enter the deployed OpenReply data-deletion address.
You should see a data-deletion URL in this format: https://YOUR-APP.vercel.app/data-deletion.
Publishing applies the app's configured access level. Your accepted tester role keeps the main account inside the supported testing scope.
- Move the Meta app to its published or Live state.
- Open Meta's current publish area for the app.
- Follow the current publishing prompts.
You should see the app status change to published or Live.
- Stop at Meta's review prompt if it blocks the tester-account path.
Accounts without an app role require Advanced Access plus App Review. Your test stays scoped to the professional account that accepted the tester role.
Before you verify the setup, which app status and callback state do you expect to see?
- Confirm that the app shows as published or Live.
- Check the app status in the main dashboard or current publish area.
You should see a published or Live status for the app.
- Confirm that OpenReply's webhook callback is verified.
- Return to the Instagram webhook setup area.
- Check the state beside the callback URL.
You should see the callback accepted or verified.
- Confirm that comments is selected when Meta permits the subscription.
- Review the selected Instagram webhook fields.
You should see comments selected when your app has the required webhook access.
That's the authorization layer in place. Next, you will connect Instagram and start the worker that sends queued DMs.
Launch and Test Your LINK Campaign
Your public dashboard is reachable. Its health check exposed one missing piece: queued jobs still have no process to send them.
Running OpenReply’s long-lived worker completes the queue so the campaign can turn Instagram comments into DMs.
In this step, get ready to:
- Connect your main Instagram account through your own Meta app. Bring the local worker to a healthy state.
- Launch a LIVE campaign that uses whole-word matching for LINK.
- Post link please! from your second account. Confirm the link DM arrives. Confirm DM Logs shows SENT.
Bring the DM pipeline online
The authorization flow lets OpenReply act through your professional account without receiving your Instagram password. OAuth keeps that permission inside Meta’s official connection process.
- Connect your professional Instagram account by choosing Connect using your own Meta app.
- Return to your deployed OpenReply dashboard.
- Select Settings from the dashboard navigation.
- Click Connect using your own Meta app.
- Complete Instagram’s authorization process with your professional account.
You should see your professional Instagram account connected in OpenReply. The authorization bridge is now complete.
The web app adds DM jobs to shared storage. A separate process must stay active to collect those jobs and send the replies.
- Start a second Claude Code session in your local OpenReply folder by using the commands for your computer:
- Press Cmd+Space on macOS or the Windows key on Windows to open system search.
- Type Terminal on macOS or PowerShell on Windows into the search field.
- Press Enter to open a second terminal.
macOS
cd ~/Downloads/openreply-main
claude
What does this command do?
- The first command returns the terminal to your downloaded OpenReply folder.
- The second command starts a new Claude Code session inside that folder.
Windows
cd $HOME\Downloads\openreply-main\openreply-main
claude
What does this command do?
- The first command returns PowerShell to your downloaded OpenReply folder.
- The second command starts a new Claude Code session inside that folder.
You should see the Claude Code prompt in the second terminal. Your original local web app remains available in its existing session.
- Ask the second Claude Code session to verify the shared settings and run the worker by pasting this request:
Check that this local worker uses the same DATABASE_URL, REDIS_URL, ENCRYPTION_KEY, and NEXTAUTH_URL as the Vercel web app. Mask all secrets. Then run npm run worker and keep it running in this terminal. Explain any startup error before changing anything.
What does this request do?
- Claude Code checks that the worker points to the same database and Redis queue as the web app.
- It also checks the encryption key and public address before starting the long-running process.
- Masking prevents the terminal response from revealing the full secret values.
You should see worker logs continue in the second terminal. Closing that terminal stops the worker and pauses future sends.
Worker not staying online?
- Confirm the second Claude Code session started inside the downloaded OpenReply folder.
- Ask Claude Code to compare the four shared variable names while keeping every secret masked.
- Keep the full startup error visible so Claude Code can explain the first cause before editing anything.
Still stuck? Help me diagnose why the OpenReply worker will not stay running.
- Keep the second terminal open for the rest of this step.
Before you check the health page, predict whether the worker status stays unhealthy or turns healthy.
- Check the complete pipeline by visiting https://YOUR-APP.vercel.app/api/health.
- Switch back to the browser tab containing your deployed OpenReply app.
- Enter https://YOUR-APP.vercel.app/api/health in the address bar.
- Press Enter to refresh the health response.
You should see healthy results for the database and Redis. The worker should now report as healthy too.
That is the missing process online. OpenReply can now collect queued campaign jobs and send them.
Configure the comment trigger and DM response
Your campaign needs a narrow trigger so unrelated comments do not receive the link. With partial matching off, the keyword matches as a complete word regardless of letter case.
- Set When someone comments on: to a specific post or reel.
- Return to your OpenReply dashboard.
- Select Campaigns from the dashboard navigation.
- Click New Campaign.
- Find When someone comments on: in the campaign builder.
- Select a specific post or reel.
You should see a control for choosing one Instagram post or reel.
- Select the learner-owned post or reel from your Campaign Plan.
- Use the post selector below the comment-source setting.
- Choose the post or reel you selected before starting the project.
You should see the selected post or reel attached to the campaign trigger.
- Set And this comment has: to a specific word or words.
- Find And this comment has: below the selected post.
- Select a specific word or words.
You should see a field for the campaign keyword.
- Enter LINK as the keyword.
- Click the keyword field under the comment condition.
- Type LINK into the field.
You should see LINK listed as the campaign’s trigger keyword.
- Set partial matching to off.
- Find the partial matching control beside the keyword settings.
- Turn the control off if it is enabled.
You should see partial matching remain off.
How will LINK match comments?
OpenReply compares the keyword without treating uppercase letters as different from lowercase letters. With partial matching off, LINK matches link please!.
The same setting does not match links because the extra letter changes the whole word.
- Set And then, they will get: to a DM with a link.
- Find And then, they will get: in the response section.
- Select a DM with a link.
You should see fields for the DM message and its link button.
- Write a short DM message that introduces your selected destination link.
- Click the DM message field.
- Type the message you want the second account to receive.
You should see your message in the campaign response preview.
- Add the selected destination link to the DM.
- Click + Add A Link.
- Paste the destination link from your Campaign Plan into the link field.
You should see your selected destination link attached to the DM.
- Enter a short button label that names the destination.
- Click the button-label field beside the destination link.
- Type the label you want the recipient to tap.
You should see the button label in the DM preview.
- Set an opening DM to off.
- Find the an opening DM option.
- Turn its control off if it is enabled.
You should see the opening DM option switched off.
- Set a follow requirement first to off.
- Find the a follow requirement first option.
- Turn its control off if it is enabled.
You should see the follow requirement switched off.
- Set a follow-up thank-you message to off.
- Find the a follow-up thank-you message option.
- Turn its control off if it is enabled.
You should see the follow-up thank-you option switched off.
- Publish the configured campaign by choosing Go Live.
- Review the selected post and keyword.
- Review the DM message and destination link.
- Click Go Live.
You should see the campaign listed as LIVE for your selected post or reel.
Your campaign is live. A whole-word LINK comment now has a configured DM response waiting behind it.
Campaign not showing as LIVE?
- Confirm you selected one post or reel before publishing.
- Confirm the response contains a message and a destination link.
- Confirm the connected Instagram account still appears in OpenReply Settings.
Need help? Help me find why my OpenReply campaign will not go LIVE.
Prove the full flow
OpenReply ignores comments posted by the connected account. Your second Instagram account supplies an independent test that follows the same path as a real commenter.
Most replies arrive quickly. If Meta does not deliver the webhook, the worker’s polling sweep can take up to five minutes.
Before you post the test comment, predict whether the lowercase keyword followed by punctuation still triggers the campaign.
- Post link please! from your second Instagram account on the campaign’s selected post or reel.
- Switch to your second Instagram account.
- Open the post or reel selected for the campaign.
- Enter link please! in the comment field.
- Publish the comment.
You should see the fresh test comment under the selected post or reel.
- Confirm the second account receives the campaign link as a private reply.
- Open the second account’s Instagram messages.
- Open the new conversation created by the campaign response.
- Tap the link button to confirm it uses your selected destination.
You should see your campaign message and link button in the second account’s messages.
- Confirm the matching result in OpenReply DM Logs.
- Return to your deployed OpenReply dashboard.
- Select DM Logs from the dashboard navigation.
- Find the row associated with the fresh test comment.
You should see a DM Logs row with the result SENT.
That completes the full flow. Your comment became a queued job before the worker delivered the link through Meta’s official API.
How private replies behave
Meta permits one private reply for each qualifying comment. OpenReply must send that reply within seven days of the comment.
The current limit is 750 private replies per hour for each Instagram professional account when replying to comments on posts or reels.
No DM after five minutes?
- Confirm the second worker terminal is still open and producing logs.
- Confirm the test came from the second account because OpenReply ignores the connected account’s own comments.
- Post a fresh qualifying comment if the earlier comment already received a private reply.
Still waiting? Help me trace why my LINK comment did not receive an OpenReply DM.
Secret mission
Keep the Worker Running with Railway
Move only OpenReply's worker to Railway so campaign jobs keep processing after the local worker terminal closes. Prove the move worked by stopping the local worker and sending a fresh keyword comment.
Clean Up Your Resources
Clean Up Your Resources
At this project scale, OpenReply's main dashboard and data services stay within free plans. Railway's worker trial is temporary, so decide whether to keep the setup active, pause its worker, or remove the resources.
Cost warning
Railway's free trial ends after 30 days or when its one-time $5 credit is exhausted. Trial deployments then stop.
Pause or delete the worker before you rely on it beyond the trial.
Resources you used:
- Personal GitHub fork of OpenReply, downloaded ZIP archive, and extracted local OpenReply folder in Downloads.
- Neon Free PostgreSQL project holding campaign records and DM logs.
- Redis Cloud Free 30 MB Essentials database holding queue state.
- Resend API key used for magic-link email.
- Vercel Hobby deployment at your vercel.app address.
- Published Meta for Developers app connected to your professional Instagram account.
- Railway free-trial service running the OpenReply worker.
Keep everything running
Keep this option while you still want your live campaign to send DMs. Everything can remain as it is during the Railway trial.
- Your Railway worker continues processing queued DM jobs.
- Your Vercel dashboard remains available at its public address.
- Your Neon project keeps the campaign records and DM logs.
- Your Redis Cloud database keeps the queue state.
- Your Resend API key continues supporting magic-link sign-in.
- Your Meta app continues authorizing OpenReply to use Instagram's official API.
- Your GitHub fork and local OpenReply files remain available for future changes.
- Your local worker stays stopped because Railway handles the queue.
Pause - I'll come back to this later
Pause the Railway worker when you want the public dashboard to remain available without sending queued DMs.
- Open the settings for the worker-only service inside your Railway project.
- Stop the Railway worker service using its service controls.
- Keep the local worker terminal stopped.
- Open /api/health on your Vercel deployment to check the worker state.
Your dashboard stays online. New DM jobs wait until a worker runs again.
Delete - I don't want to use this again
The deletion is permanent, including the campaign records and DM logs stored in Neon. Your service accounts stay open after the project resources are removed.
Delete hosted resources:
- Open the settings for the worker-only service inside your Railway project.
- Delete the Railway worker service from its service deletion area.
- Confirm the Railway project no longer contains a running worker service.
- Open the settings for your OpenReply project in Vercel.
- Delete the Vercel project from its project deletion area.
- Confirm its vercel.app address no longer loads the dashboard.
- Open the settings for your published OpenReply app in Meta for Developers.
- Delete the Meta app from its app deletion area.
- Confirm the app no longer appears in your Meta app list.
- Open the API key area in Resend.
- Delete the API key used by OpenReply.
- Confirm the API key no longer appears in your Resend account.
- Open the settings for your 30 MB Essentials database in Redis Cloud.
- Delete the Redis Cloud database from its database deletion area.
- Confirm the database no longer appears in your Redis Cloud database list.
- Open the settings for your OpenReply project in Neon.
- Delete the Neon project from its project deletion area.
- Confirm the project no longer appears in your Neon project list.
Delete your GitHub fork and local copy:
- Open the repository settings for your personal OpenReply fork on GitHub.
- Delete the fork from the repository deletion area.
- Confirm the fork's GitHub address no longer loads the repository.
- Close the terminal running the local OpenReply web app if it is still open.
macOS
The local OpenReply folder contains your uncommitted .env file. Removing the folder also removes those local secrets from your Mac.
- Open the Downloads folder in Finder.
- Move the openreply-main folder at ~/Downloads/openreply-main to the Trash.
- Move the original OpenReply ZIP archive to the Trash if it remains in Downloads.
- Empty the Trash to remove the local project files permanently.
Windows
The local OpenReply folder contains your uncommitted .env file. Removing the folder also removes those local secrets from your Windows computer.
- Open the Downloads folder in File Explorer.
- Open the outer openreply-main folder.
- Move the inner openreply-main folder at $HOME\Downloads\openreply-main\openreply-main to the Recycle Bin.
- Move the original OpenReply ZIP archive to the Recycle Bin if it remains in Downloads.
- Empty the Recycle Bin to remove the local project files permanently.
Your service accounts remain open after this cleanup. You can reuse them for another project.
Nice Work!
Nice Work!
You did it. Your OpenReply automation now turns a whole-word LINK comment into a link DM through the Instagram API while your local worker remains stopped.
You've learned how to:
- Use Claude Code to configure a self-hosted OpenReply setup without writing application code. Keep credentials out of the repository through local environment variables.
- Deploy a public Vercel Hobby dashboard backed by Neon PostgreSQL plus Redis Cloud. Verify the shared services through the health endpoint.
- Authorize your professional Instagram account through a personal Meta app. Launch a whole-word LINK campaign that produces a SENT result in DM Logs.
- Secret Mission: Run the long-lived worker on Railway. Prove campaign DMs continue while the local worker remains stopped.
Ready to quiz yourself?