https://github.com/digitalpetri/opc-ua-demo-server
OPC UA Demo Server for Eclipse Milo
https://github.com/digitalpetri/opc-ua-demo-server
milo opc opc-ua opcua server
Last synced: 20 days ago
JSON representation
OPC UA Demo Server for Eclipse Milo
- Host: GitHub
- URL: https://github.com/digitalpetri/opc-ua-demo-server
- Owner: digitalpetri
- Created: 2019-02-26T00:10:53.000Z (about 6 years ago)
- Default Branch: 1.0
- Last Pushed: 2025-04-02T00:12:03.000Z (25 days ago)
- Last Synced: 2025-04-02T01:24:23.017Z (25 days ago)
- Topics: milo, opc, opc-ua, opcua, server
- Language: Java
- Homepage:
- Size: 1.68 MB
- Stars: 86
- Watchers: 7
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eclipse Milo OPC UA Demo Server
This is a standalone OPC UA demo server built
using [Eclipse Milo](https://github.com/eclipse-milo/milo).An internet-facing instance of this demo server is accessible at
`opc.tcp://milo.digitalpetri.com:62541/milo`.It accepts both unsecured and secured connections. All incoming client certificates are automatically trusted.
Authenticate anonymously or with one of the following credential pairs:
- `User` / `password`
- roles: `WellKnownRole_AuthenticatedUser`
- `UserA` / `password`
- roles: `SiteA_Read`, `SiteA_Write`
- `UserB` / `password`
- roles: `SiteB_Read`, `SiteB_Write`
- `SiteAdmin` / `password`
- roles: `SiteA_Read`, `SiteB_Read`
- `SecurityAdmin` / `password`
- roles: `WellKnownRole_SecurityAdmin`## Building
### Docker
Build the Docker image:
```bash
docker build . -t opc-ua-demo-server
```Start the server:
```bash
docker run --rm -it -p 4840:4840 opc-ua-demo-server
```In order to have access to the `server.conf` file and security directories, you may want to mount a
volume mapped to the container's `/app/data` directory:```bash
docker run --rm -it -p 4840:4840 -v /tmp/opc-ua-demo-server-data:/app/data opc-ua-demo-server
```### Maven + JDK 21+
**Using JDK 21+**, run `mvn clean package` in the root directory.
An executable JAR file will be created in the `target` directory. This JAR file can be run with
`java -jar target/opc-ua-demo-server.jar`.## Configuration
### Server
On startup the server loads its configuration from `/app/data/server.conf`. If it doesn't exist, the
default configuration from `src/main/resources/default-server.conf` will be copied to that location.The server configuration file is in HOCON format and its configuration keys and values are
documented with comments.### Security
The server's application instance certificate is stored in the KeyStore at
`/app/data/security/pki/certificates.pfx`. If the server starts and this file doesn't exist it will
generate a new one.Issuer and trusted certificates are managed using the standard OPC UA PKI layout found at
`/app/data/security/pki/issuer` and `/app/data/security/pki/trusted`.Certificates from untrusted clients can be found at `/app/data/security/rejected` after they have
attempted to connect at least once. Moving a client certificate to
`/app/data/security/pki/trusted/certs` will mark it "trusted" and allow the client to connect with
security enabled.These directories are monitored by the server and changes will be picked up automatically.