Table of Contents
ToggleOpenPLC turns an ordinary Ubuntu PC into a soft PLC that you program in ladder logic and control from a browser. We install it from scratch, start it, log in and check the default settings before any program is written.
Install the free OpenPLC runtime on Ubuntu, start it and log in to its web dashboard. Every screenshot comes from a real install we ran for this lesson, with the commands, timings and default ports.

How do you do an OpenPLC installation on Linux?
OpenPLC installation on Linux takes one script: clone the OpenPLC_v3 repository and run ./install.sh linux, which builds the compiler, protocol libraries and runtime. On our 2 core Ubuntu 24.04 test machine it finished in about 4 to 6 minutes. Then start the runtime, open localhost:8080 in a browser and log in with openplc and openplc.
- sudo apt update and install git.
- git clone https://github.com/thiagoralves/OpenPLC_v3
- cd OpenPLC_v3 and run ./install.sh linux
- Start it with the openplc service or ./start_openplc.sh
- Open localhost:8080 and log in as openplc / openplc.
- Change the default password under Users.
What Is OpenPLC and Why Install It on Linux?
OpenPLC is a free, open source soft PLC that runs IEC 61131 3 programs on a normal computer, and an OpenPLC installation on Linux gives you a working controller with a browser dashboard. You can practise ladder logic, test Modbus and run real programs without buying hardware.
- One command builds everything: ./install.sh linux.
- Web dashboard on port 8080, default login openplc / openplc.
- Modbus TCP server on port 502 is enabled by default.
- Our install on Ubuntu 24.04 took about 4 to 6 minutes.
PLC Tutorials series: this is lesson 1. The series continues lesson by lesson, from the first ladder program to timers, counters, analog scaling, PID and Modbus, and every lesson is tested on the runtime you install today.
If PLCs are new to you, read what a PLC is first. A soft PLC does the same job in software, and our list of free PLC programming software compares it with other free options.
What Do You Need Before You Start?
For an OpenPLC installation on Linux you need a 64 bit Ubuntu or Debian based PC or virtual machine, an internet connection and a user with sudo rights. We tested on Ubuntu 24.04 with 2 CPU cores, and the script pulled its own build tools.
| Item | What we used | Note |
|---|---|---|
| Operating system | Ubuntu 24.04 | Debian based distros use apt |
| CPU | 2 cores | More cores build faster |
| Access | sudo or root | Script installs packages |
| Network | Internet | git and apt downloads |
| Browser | Any modern browser | Dashboard on port 8080 |
The installer adds build tools such as gcc, cmake, bison and flex, plus sqlite3 and a Python virtual environment for the web server. You do not need to install them by hand first.
The OpenPLC webserver is a Python Flask app. When you upload a program, it calls the MatIEC compiler to turn Structured Text into C code and then builds a fresh runtime binary.
How Does the OpenPLC Runtime Work on a PC?
The runtime is a C++ program that scans your PLC logic in a loop, while a web server lets you upload programs and start or stop the PLC. Field signals come in through a hardware layer, and SCADA or HMI software reads data over Modbus TCP, EtherNet/IP or the S7 protocol.

Your .st file goes to the webserver, iec2c converts it to C, and g++ links it into the runtime. The PLC core then reads inputs, solves the logic and writes outputs every scan, the same cycle explained in how the PLC scan cycle works.
The hardware layer decides where inputs and outputs come from. A fresh install uses the blank Linux layer, so the PLC runs but nothing is wired to it yet.
OpenPLC Installation on Linux Step by Step
The whole OpenPLC installation on Linux is a clone and one script, followed by a start command. Run the commands below in a terminal, one line at a time.
The script builds the MatIEC compiler, the ST optimizer, the glue generator, OpenDNP3, libmodbus and snap7, then compiles a blank program as a self test. It also writes everything it prints into install_log.txt in the same folder, which is the first file to read if anything fails.

In linux mode the script also creates and enables a systemd service called openplc, so the runtime starts by itself after a reboot. On a container or WSL without systemd you see a harmless "System has not been booted with systemd" line, and you start the runtime with ./start_openplc.sh instead.
The start script runs the Flask webserver from a Python virtual environment inside the folder. The log above shows it listening on port 8080 for the dashboard and on port 8443 over HTTPS for the REST API.
How to Log In to the OpenPLC Dashboard
Open http://localhost:8080 and log in with username openplc and password openplc. From another computer on the same network, use the PC IP address followed by :8080.

After login you land on the Dashboard with the Blank Program loaded and the status Stopped. Press Start PLC in the left menu, and the runtime log fills with the protocol servers coming up.

Read the runtime log line by line once. It tells you which servers started, which ports they use and whether slave devices were configured, and you will use it again in every later lesson.
Ports below 1024, such as Modbus port 502, can only be opened by a privileged process on Linux. That is one reason the OpenPLC service runs as root.
Which Default Settings Should You Check First?
Check the Settings page right after the OpenPLC installation on Linux, because it decides which protocols listen on the network. On our fresh install Modbus, S7 and EtherNet/IP were on, while DNP3, persistent storage and start in RUN mode were off.

| Setting | Default | When to change |
|---|---|---|
| Modbus server | On, port 502 | Keep on for monitoring and HMI |
| S7 protocol | On | Turn off if unused |
| DNP3 server | Off, port 20000 | Only for DNP3 masters |
| EtherNet/IP | On, port 44818 | Turn off if unused |
| Persistent storage | Off, 10 | Turn on for retained values |
| Start in RUN mode | Off | Turn on for unattended PCs |
| Slave polling and timeout | 100 ms, 1000 ms | Tune for slow RTU devices |
Leave Modbus on: the Monitoring page reads live values through it, and our later lessons depend on that. If the Modbus server is off, Monitoring only shows a message asking you to enable it.
Turn on Start OpenPLC in RUN mode only on a PC that must resume control after a power cut. For a learning machine, starting in Stop is safer because you decide when the program runs.
How Do OpenPLC Addresses Map to Modbus?
OpenPLC maps every located variable to a fixed Modbus address, so an HMI or SCADA package can read and write it without extra setup. Bits use byte x 8 + bit, and words use their own number, with %MW offset by 1024.

%QX2.5: 2 x 8 + 5 = coil 21
Holding register = 1024 + n
%MW10: 1024 + 10 = register 1034
These are zero based protocol addresses, the numbers a Modbus client sends on the wire. Some HMI packages show them with a 1 based or 40001 style offset, which the Modbus register map guide explains, along with the Modbus function codes used to read each table.
Use the calculator to convert any OpenPLC bit or memory word before you configure a client.
For a wider view of PLC addressing schemes, see PLC memory addressing.
Siemens and Allen Bradley Equivalents
Siemens and Allen Bradley do not offer a Linux soft PLC for learning; their programming tools run on Windows. Siemens uses TIA Portal with PLCSIM to simulate S7 CPUs, and Rockwell uses Studio 5000 with an emulator for Logix controllers.
- Free, open source and runs on Linux
- IEC 61131 3 languages: LD, FBD, ST, IL and SFC
- Real Modbus TCP server for HMI practice
- Vendor specific instructions and diagnostics
- Certified safety PLCs
- Hardware configuration of real racks and cards
The ladder logic you learn here carries over, because all three follow the same IEC 61131 3 programming languages ideas. When you move to vendor hardware, compare families in S7 1200 vs S7 1500 and types of Allen Bradley PLCs.
Common Installation Problems and Fixes
Most failed attempts at an OpenPLC installation on Linux come from a blocked package manager, a missing build tool or a port already in use. Follow this flowchart and read install_log.txt before running the script again.

| Symptom | Likely cause | Fix |
|---|---|---|
| Could not get lock on dpkg | Another apt process running | Wait for it, run install.sh again |
| Error compiling MatIEC | Build tools missing | Check apt output in the log |
| localhost:8080 does not open | Runtime not started | Start the service or script |
| Address already in use | Old runtime still running | Stop it, then start again |
| Monitoring asks for Modbus | Modbus server disabled | Enable it in Settings |
- install_log.txt ends with Compilation finished successfully!
- Dashboard opens on port 8080.
- After Start PLC the status reads Running.
- Modbus server is enabled on port 502.
- Default password changed under Users.
Run only one apt task at a time. A second apt command during install.sh locks dpkg and the installer skips its package step.
Treat the dashboard like any PLC engineering port: keep it off the internet, change the password and segment the network, as covered in PLC remote access security and cybersecurity standards for PLCs.
The video below shows an OpenPLC installation on Linux step by step. Pause it after the installer finishes and compare your log with ours.
Next you will write programs in ladder logic, so revise ladder logic for beginners and the PLC programming languages. Then test yourself with our PLC objective quiz.
OpenPLC Installation on Linux FAQ
On our 2 core Ubuntu 24.04 machine the script finished in about 4 to 6 minutes. Most of that time goes into compiling OpenDNP3 and the other libraries.
A faster CPU shortens it, and a slow internet link lengthens the package step.
The default login is username openplc and password openplc. You enter it on the login page at port 8080 after the runtime starts.
Change it under Users right after the first login, because anyone with these details can upload, start and stop a program.
The dashboard listens on port 8080, so you open http://localhost:8080 on the same PC. From another computer on the same network, use the PC IP address with :8080.
The runtime also serves a separate REST API over HTTPS on port 8443.
In linux mode the installer creates and enables a systemd service named openplc, so it starts at boot. Check it with sudo systemctl status openplc.
To also run the program at boot, tick Start OpenPLC in RUN mode in Settings.
The Monitoring page reads live values through the runtime Modbus server. If the Modbus server is disabled in Settings, the page shows that message instead of the live table.
Enable the server on port 502, save the changes, and open Monitoring again.
Yes, the same install.sh has options for Windows, Raspberry Pi and Docker. The steps after installation, the web dashboard and the default login stay the same on each platform.
A later lesson in this series covers the Raspberry Pi hardware layer in detail.
Related Articles
- What Is a PLC
- Free PLC Programming Software
- PLC Programming Languages
- PLC Simulation Software for Virtual Commissioning
- Modbus Register Map
External References
- Security Issues on the OpenPLC Project and Corresponding Solutions (PDF)
- OpenPLC on Linux, runtime installation page
- Programmable logic controller (Wikipedia)
What We Learn Today
- OpenPLC installation on Linux is a git clone and one script, ./install.sh linux, which builds the compiler, protocol libraries and the runtime itself.
- The dashboard runs on port 8080 with the default login openplc and openplc, and that password should be changed right after the first login.
- OpenPLC maps bits to Modbus as byte x 8 + bit, so %QX2.5 is coil 21, and %MW words start at holding register 1024.

