How to Host the Discord-Captcha-Fishing Source on Linux
In this tutorial, you’ll learn how to host the Discord-Captcha-Fishing
project on a Linux VPS. We’ll use Nginx (a web server tool) and pm2
(to keep the bot and server running). Everything starts with the main.mjs
file.
Prerequisites
- A VPS with Linux (Ubuntu recommended).
- SSH access (you’ll need the VPS IP and password).
- A domain (e.g.,
yoursite.com
) that you’ll configure to point to your VPS IP.
Step 1: Configure Your DNS
Before setting up the server, you need to point your domain (e.g., yoursite.com
) to your VPS IP. This is done in your domain provider’s control panel (e.g., GoDaddy, Namecheap, Cloudflare). Here’s how:
- Log in to Your Domain Provider:
- Go to the website where you bought your domain and log in.
- Find the DNS Settings:
- Look for something like "DNS Management," "Nameservers," or "Zone Editor."
- Add an A Record:
- Create a new record:
- Type:
A
(this links your domain to an IP). - Name/Host: Leave it blank or use
@
foryoursite.com
, and usewww
forwww.yoursite.com
. - Value: Enter your VPS IP (e.g.,
123.456.78.90
). - TTL: Use the default (e.g., 3600) or set to 600 for faster updates.
- Save the changes.
- Wait for DNS to Update:
- This can take a few minutes to 24 hours. To check if it’s ready, type
ping yoursite.com
in your terminal or command prompt. If it shows your VPS IP, it’s working.
- This can take a few minutes to 24 hours. To check if it’s ready, type
Note: Do this for both yoursite.com
(blank or @
) and www.yoursite.com
(use www
as the name).
Step 2: Connect to Your VPS
- Open a terminal on your computer:
- On Windows, use "Command Prompt" or download "PuTTY."
- On Mac/Linux, use "Terminal."
- Type this command, replacing
123.456.78.90
with your VPS IP:
- Enter your password when asked (you won’t see it as you type, that’s normal!).
Step 3: Update the System and Install Tools
Install the necessary programs. Copy and paste each command into the terminal and press Enter
:
If it asks for "yes" or "y," type y
and press Enter
.
Step 4: Download the Project
Grab the project from GitHub:
Step 5: Edit the Configuration File
- Open the
config.json
file to add your details:
- Use the arrow keys to move around. Edit things like:
- The Discord bot token (get it from the Discord website if you don’t have it).
- Other settings the project needs.
- To save and exit:
- Press
Ctrl + X
(hold Ctrl and press X). - Type
y
to confirm. - Press
Enter
to exit.
- Press
Step 6: Configure Nginx
We’ll use the default Nginx file and add our settings.
- Open the default file:
- Delete everything (hold
Ctrl + K
to erase line by line until it’s empty). - Copy and paste this text:
- Replace
yoursite.com
with your real domain (e.g.,myproject.com
). - Save and exit:
- Press
Ctrl + X
. - Type
y
. - Press
Enter
.
- Press
- Restart Nginx:
Step 7: Add HTTPS Security with Certbot
Now that DNS is set, secure your site with HTTPS:
- Replace
yoursite.com
with your domain. - Answer the questions:
- Enter your email when asked.
- Choose
2
to redirect all traffic to HTTPS (recommended).
Step 8: Run the Project with PM2
- Install the project’s dependencies:
- Start the bot and server with
pm2
:
- Save the PM2 setup:
- Set PM2 to start with the system:
Step 9: Open Firewall Ports
Open ports 80 and 443 for the site:
Step 10: Test Everything
- Open your browser and go to
https://yoursite.com
orhttps://www.yoursite.com
. - If something loads, the server is working!
- Check the bot on Discord.
- If there’s an issue, see the errors with:
Tips for Beginners
- If the site doesn’t load, ensure your DNS is pointing to the VPS IP (use
ping yoursite.com
to check). - If Nginx fails, test it with:
- Stuck? Copy the error message and ask for help!
Done! Your project is live with HTTPS, no file size limits, and the bot is running smoothly. Enjoy!