Configure PyCharm Professional Remote SSH Interpreter for Server-Side Python Development
Step-by-step guide to configuring PyCharm Professional's Remote SSH Interpreter: prerequisites, interpreter setup, deployment sync, debugging verification, and recovery options for connection issues.
07 Aug 2026, 11:25 UTC

Desired Outcome
Edit, run, and debug Python code in PyCharm on your local machine while the interpreter, dependencies, and execution environment live on a remote Linux server accessed via SSH. This setup keeps your local workstation lightweight and ensures code runs against the exact production-like environment.
Prerequisites
- PyCharm Professional 2023.1 or later — Community Edition does not include remote interpreter support.
- SSH access to a Linux or macOS host with Python 3.8+ installed.
- Key-based authentication configured (recommended over password). Generate with
ssh-keygen -t ed25519and copy the public key to~/.ssh/authorized_keyson the remote host. - Project files either already on the remote host or ready to sync via SFTP.
- Network connectivity allowing SSH (port 22 or custom) from your workstation to the remote host.
Procedure: Add the Remote Interpreter
- Open Settings → Project: <name> → Python Interpreter.
- Click the gear icon ⚙️ → Add Interpreter → On SSH.
- In the dialog, enter:
- Host: remote server hostname or IP
- Port: SSH port (default 22)
- Username: your remote account
- Authentication type: Key pair (OpenSSH or PuTTY) — select your private key file (e.g.,
~/.ssh/id_ed25519) and passphrase if set.
- Click Next. PyCharm connects and scans for Python executables. Choose an existing interpreter (e.g.,
/usr/bin/python3.11) or create a new virtual environment on the remote host (~/venvs/myproject). - On the Path Mappings screen, map your local project root to the remote project directory. Example:
Local path: /Users/you/projects/myappRemote path: /home/you/myapp - Enable Automatic upload of changed files to the remote host (or choose On explicit save action if you prefer manual control).
- Click Finish. PyCharm downloads skeleton files for code completion — wait for the indexer to complete (status bar shows progress).
Deployment Synchronization Details
The path mapping from step 6 creates a Deployment configuration (Settings → Build, Execution, Deployment → Deployment). This SFTP-based sync handles file transfers. Key settings to review:
- Mappings tab: Verify local ↔ remote paths. Add exclusions for
.git,__pycache__,.venv,node_modules, and large data directories to reduce bandwidth and indexing load. - Options tab: Set Upload changed files automatically to the default server to On explicit save (Ctrl+S) if multiple developers edit the same remote files — this prevents accidental overwrites. For solo work, Always is convenient.
- Excluded Paths: Add patterns like
*.pyc,*.log,*.tmp.
Expected Checks: Verify the Setup Works
1. Interpreter Package List
Return to Settings → Python Interpreter. The package table should show packages installed in the remote environment (e.g., numpy, requests, django) with versions matching the remote pip list output.
2. Run a Test Script
Create verify_remote.py in your project:
import sys
import platform
print("Executable:", sys.executable)
print("Platform:", platform.platform())
print("Python:", sys.version)
print("Path entries:")
for p in sys.path:
print(" ", p)
Right-click → Run 'verify_remote'. Output must show the remote Python path (e.g., /home/you/venvs/myproject/bin/python) and remote sys.path entries.
3. Debugger Breakpoint Test
Add a breakpoint on the print("Platform:", ...) line. Right-click → Debug 'verify_remote'. Execution should pause, and the Variables pane must display sys, platform objects with inspectable attributes. Hover evaluation and Evaluate Expression (Alt+F8) should work.
4. Remote Terminal
Open Tools → Start SSH Session → select your deployment config. A terminal tool window opens a shell on the remote host. Run python3 -c "import sys; print(sys.executable)" — it should match the interpreter path from step 2.
5. Deployment Log
Open Tools → Deployment → Browse Remote Host. The remote file tree appears with timestamps. Edit a file locally, save (or trigger sync), and confirm the remote timestamp updates.
Recovery Options
Connection Drops / Sync Drift
If the SSH session times out or files diverge:
- Tools → Deployment → Sync with Deployed to... → choose Remote to Local or Local to Remote → review diff → apply.
- For a full reset: File → Invalidate Caches → check Clear file system cache and Local History → Invalidate and Restart.
SSH Keep-Alive to Prevent Timeouts
Edit ~/.ssh/config on your local machine:
Host myserver
HostName 192.0.2.10
User you
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 30
ServerAliveCountMax 4
TCPKeepAlive yes
This sends a keep-alive packet every 30 seconds; after 4 missed responses (2 minutes), the client terminates cleanly instead of hanging.
Fallback to Local Interpreter
If the remote host is unreachable (travel, outage), switch quickly: Settings → Python Interpreter → gear → Add Interpreter → Local → select a local virtualenv. Your run/debug configurations retain their settings; just change the interpreter dropdown in each configuration.
Version-Sensitive Behavior Notes
- 2023.2+: Partial Git fetch over SSH — PyCharm can fetch only needed objects when the project root is on the remote host, reducing bandwidth.
- 2024.1+: Improved WSL2 detection — if your "remote" is actually WSL2 on Windows, PyCharm now auto-detects and configures the interpreter without manual SSH setup.
- Docker-based remote interpreters: Separate workflow (Settings → Python Interpreter → Add → Docker) — not covered here.
Limitations & Cautions
- Professional Edition required — no workaround for Community Edition.
- Automatic upload on save can overwrite concurrent remote edits. Use version control (Git) as the source of truth; treat deployment sync as a convenience, not a collaboration tool.
- Large remote projects (10k+ files) consume significant local memory during indexing. Exclude build artifacts, virtual environments, and data directories in Deployment → Mappings → Excluded Paths.
- Network latency affects code completion and debugger responsiveness. For high-latency links (>100 ms), consider a local replica of the environment for editing, remote only for final test runs.
Practical Verification Checklist
| Check | How to Verify | Pass Criteria |
|---|---|---|
| Interpreter resolved | Settings → Python Interpreter shows remote path | Path starts with /home/ or /opt/, not local |
| Packages visible | Package list matches pip list on remote | Versions align; no "package not found" warnings |
| Run target | Run config uses remote interpreter | Console output shows remote sys.executable |
| Debugger attaches | Breakpoint pauses; Variables pane populated | Can inspect locals(), evaluate expressions |
| File sync | Tools → Deployment → Browse Remote Host | Timestamps update after local save |
| Terminal works | Tools → Start SSH Session | Shell prompt appears; commands execute remotely |
Run through this checklist after initial setup and after any PyCharm or remote host upgrade.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.