How to Seamlessly Run Python Code on a Remote Server Using PyCharm
This guide walks you through configuring PyCharm to connect to a remote Linux server, set up an SSH Python interpreter, enable automatic file synchronization, and run long‑running web‑scraping scripts directly on the server, streamlining development without manual file transfers.
Preface
This article shows how to configure PyCharm to use a Python environment on a remote server.
Why do it?
The author needed to run a long‑running web‑scraping script on a remote machine without manually transferring files.
My environment
滴滴云 ubuntu 18.04 version, installed Anaconda
pycharm2019 professional editionNote:
PyCharm must be the Professional edition to support remote interpreter.
Prefer using Anaconda on Linux to avoid conflicts with the system pip.
Steps
Configure remote server information
Open PyCharm → Tools → Deployment → Configuration and add a new SFTP server, give it a name, and fill in the host, port, username and password.
Set up the Connection and Mappings sections, then click OK.
Enable automatic upload via Tools → Deployment → Automatic Upload.
Configure remote Python interpreter
Open
File → Settings → Project: <project name> → Project Interpreter, click the plus sign, choose SSH Interpreter, enter the server details, and select the path to the remote Python executable.
Apply the settings and confirm.
Synchronize code
Press Ctrl+S (or enable automatic upload) to push local changes to the remote /tmp directory.
Applicable scenarios
Ideal for web‑scraping projects or any long‑running tasks that need to run on a remote Linux server without manual file transfers.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
