Running PRSM locally or on an intranet

Some organisations would prefer to run PRSM entirely within their own intranet. Sometimes it may be desirable to run PRSM just on one computer working offline. For these cases, PRSM is also available in 'containerised' form, which makes it easy to install it on a local server on an intranet, or even on a laptop. The server can be a Linux, Windows or Apple Mac machine. The following instructions assume that you have some experience with using the command line in a Terminal or Powershell.

Info

The API feature and the AI assistance are not available when running PRSM from a container, because they require access to or from outside the container.

  1. Check to see whether python3 is already installed, by typing python3 --version at the command prompt. If it responds with the version of the python installation, you can go on to the next step. If you get an error message, you will need to install python, using these instructions.

  2. Install podman using these instructions.

  3. Install podman-compose using the command:
    pip3 install podman-compose

  4. If not already done during the installation, run:

    podman machine init
    podman machine start
  5. Create a blank, plain text file in a convenient directory and name it compose.yaml. Use a text editor to copy the following into the file (be sure to use a text editor, not a word processor):

            services:
              y-websocket:
                image: docker.io/micrology/prsm-y-websocket
                ports: 
                  - "1234:1234"
                restart: unless-stopped
              htppd:
                image: docker.io/micrology/prsm-httpd
                ports:
                  - "8080:8080"
                restart: unless-stopped
  6. Save the file and then run the command:
    podman-compose up -d
    in the same directory as the compose.yaml file

  7. In a web browser, on the same computer, enter http://localhost:8080 in the address bar. You should see the PRSM welcome page (the same as at https://prsm.uk). Click on the 'Start now' button to get to a blank PRSM map. This copy of PRSM is running entirely locally: you can disconnect the computer from the internet and it will still function.

If the computer is on a local intranet, it should be possible to access this local version of PRSM with a URL something like http://168.192.0.123:8080, where the IP address is the local intranet address of the server (or if it has one, you can use the local network name of the computer, followed by :8080 as the port number).

Tip

If the browser reports that the location is not found, check for access being blocked by a firewall. A firewall needs to pass ports 8080 and 1234. These port numbers can be changed to any free numbers above 1000 by stopping the service (see below) and editing the compose.yaml file to xxxx:1234and yyyy:8080, substituting the new numbers for xxxx and yyyy.

To stop the PRSM service, navigate to the directory with the compose.yaml file and enter the command:
podman-compose down

Maps (rooms) created using the containerised version are independent of those created using the usual https://prsm.uk location. You can however save the map to a PRSM file and reload the file in the other environment.

Maps are only preserved within the container so long as the container is running. If the container is stopped, the maps disappear (although you can save them first to a file), unless an external directory is attached to the container when it is started. To attach an external directory, edit the compose.yaml file to add the section shown below:

  y-websocket:
    image: docker.io/micrology/prsm-y-websocket
    ports: 
      - "1234:1234"
    restart: unless-stopped
# to provide persistence for maps, bind a local directory to the container. 
# The local directory will be created if it does not exist. 
# The container will write map data to this directory, and read from it when it starts up.
    volumes:
      - type: bind
      # replace the source, `./ws-server/db`, with the path to the local directory you want 
      # to use for persistence.  The path may be relative to the location of this file
      # or an absolute path (on Windows, use an absolute path).
      # The container will read and write map data to this directory.
        source: ./ws-server/db
        target: /db

After editing compose.yaml, stop the container with podman-compose down and restart it with podman-compose up -d.