Server Connection Guide¶
This guide explains how to connect to your production server using the new server:connect command.
Setup¶
-
Add the server IP to your .env file:
-
If you don't have a .env file, create one:
Usage¶
Connect to your server:
This will:
- Check that the SERVER_IP environment variable is set
- Display a connection message
- Establish an SSH connection to your server
Security Notes¶
- Never commit the actual IP address to version control
- The IP address is stored in the .env file (which is gitignored), not in the code
- Make sure your SSH keys are properly configured on the server
- Consider using a non-root user for better security practices
Troubleshooting¶
If you get a "SERVER_IP is not set in .env file" error: 1. Make sure you have a .env file in your project root 2. Check that SERVER_IP is defined in your .env file 3. Verify the .env file syntax (no spaces around the = sign)
If SSH connection fails: 1. Verify your SSH keys are added to the server 2. Check that the IP address is correct 3. Ensure the server is accessible from your network