An internal app on a server without internet access: how to do it properly

In short

A server with no internet access is a common requirement in companies that guard their data. A modern app can still run on it: dependencies are downloaded beforehand on another computer, libraries without system dependencies are chosen, and updates are installed as a tested package. You just have to plan installation, updates, backups and diagnostics from the start.

Key points
  • You download dependencies on a computer with internet access and move them as a folder of ready packages.
  • Choose libraries that install without a compiler or extra system programs.
  • An update is a tested package with a version number and a rollback plan, not copying files live.
  • Logs, backups and monitoring have to be planned locally, because outside services are out.

Why companies want it

A server cut off from the internet means a smaller attack surface and a simpler answer to the question of where the data is. Systems with personal, HR or production data often run this way. An app on such a server can still use the company network: the database, the user directory or the company mail server.

Caution

No internet doesn't mean no updates. A server cut off from the network still needs security patches; they just arrive another way: downloaded and checked on a trusted computer.

Dependencies without internet

  1. Download the packages on a computer with internet access

    Ideally with the same Python version and the same system as the server. The pip download command saves all the dependencies to a folder.

  2. Check they are ready-made wheels

    Wheel files (.whl) install without compiling. If the folder contains a source archive, installation will fail on a server without a compiler.

  3. Move the folder to the server

    Together with the requirements.txt file, with the versions pinned.

  4. Install without network

    pip install with the --no-index and --find-links options takes packages only from the local folder.

Offline installation
# on a computer with internet access (same Python version as the server)
pip download -r requirements.txt -d packages --only-binary=:all: --platform win_amd64 --python-version 3.12

# on the server, without internet access
pip install --no-index --find-links packages -r requirements.txt
Tip

Pure-Python libraries or ones shipped as ready-made wheels save the most trouble. Two examples from practice: for LDAP, the ldap3 library instead of python-ldap, which needs system libraries; and for turning PDF pages into images, PyMuPDF, which comes as a single wheel.

An application server on Windows

On Linux the standard for Python apps is gunicorn, but it doesn't run on Windows. There, Waitress, written in pure Python, does the job. In front of it sits a web server, on Windows usually IIS, as a reverse proxy: it handles HTTPS and the site address, and passes traffic on to the app.

Checklist0 of 5

Updates without internet

  1. A version with a number and a changelog

    Every update is a package: code, dependencies and a description of what changed.

  2. A test on a copy

    A test environment with a copy of the database. An update that passed there rarely surprises in production.

  3. A database backup right before the update

    Regardless of the daily backups.

  4. Installation and database migrations

    In a planned window, with a message for users.

  5. A rollback plan

    The previous package and the database backup at hand. If something doesn't work, you're back in minutes and fix it calmly.

Diagnostics and order on site

Checklist0 of 6

Terms from this guide

Reverse proxy

A server that receives traffic from the network and passes it on to an app running behind it. It usually also handles HTTPS and the site address.

Wheel

A ready-to-install Python library package, a .whl file. It installs without compiling, also on a server without internet access.

Questions and answers

Can an app without internet send email?

Yes, through the company mail server on the internal network. Being cut off applies to the internet, not to the company network.

How do you install security patches?

The same way as dependencies: downloaded on a trusted computer, checked and moved over. For Windows, companies often use their own update server (WSUS).

Can AI run on such a server?

Yes. A local language model works without internet if the server has a suitable graphics card. Details are in the guide to hardware for a local model.

Sources and documentation

The service related to this guide

IT infrastructure and server administration

Describe the problem

Question 1 of 5

What would you most like to improve?

Pick the closest one. It doesn't have to fit perfectly.

First summary

This is a first suggestion based on a few answers, not a diagnosis. Nothing is saved until you send the message.