Forums

Feasibility check: running a persistent local Java signing service (reachable via localhost) — Always-on tasks + outbound access on Free plan?

Hi everyone,

I'm currently on the Free plan and considering upgrading, but I'd like to confirm a couple of things are actually possible here before I do.

Context: I run a Flask web app that needs to talk to a small, official third-party signing microservice (provided by a government tax authority, not something I built). This service:

  • Ships as a standalone Java .jar file — a lightweight local REST service, not a full app server.
  • Needs to run continuously in the background, listening on a local port (e.g. localhost:8113).
  • Gets called by my Flask app via a simple HTTP POST to http://localhost:8113/... — so it needs to be reachable via localhost from within the same account as my web app.

Questions:

  1. Always-on tasks — Can an Always-on task run a long-lived process that binds/listens on a local port, and have that port be reachable via localhost from my web app (same account)? Or are Always-on tasks and web apps isolated from each other on the network level?
  2. Java availability — Is a JRE available out of the box, or can one be installed, so I can run java -jar my-service.jar from an Always-on task?
  3. Outbound access on paid plans — I understand the Free plan restricts outbound HTTPS to a whitelist of allowed domains. Can someone confirm paid plans have unrestricted outbound access to any external HTTPS domain (I specifically need to reach a *.gob.sv government API)?

I want to make sure this whole setup is actually feasible before committing to a paid plan. Any pointers (or "no, that won't work, here's why") would be really appreciated!

Thanks in advance.

<hr />
  1. No. They are not on the same machine and the location of the always on task can change.
  2. JRE is available, but we provide no support if you want to use it. The version that is there is the version that is available and we will not change it.
  3. Yes, assuming the site accepts connections

Thanks for the previous answers, they were very helpful. I have a follow-up question based on your reply:

You confirmed that an "Always-on task" is not guaranteed to run on the same machine as the web app worker, and that its location can change. This matters for my use case: I need to run a local signing tool (a Java process exposing an HTTP endpoint on localhost, provided by our government's e-invoicing platform) that my Flask web app calls via http://localhost:PORT/... for every request that needs a digital signature.

Given that an Always-on task won't reliably share the same machine as the web app:

  • If I instead launch that Java process as a subprocess directly from within the web app itself (e.g., started once at WSGI worker startup, via subprocess.Popen, and kept running alongside the Flask process for its whole lifetime), would that process reliably stay on the same machine as the web worker handling the requests, so calls between them would work?
  • Or does the web app itself also not have a guaranteed single/stable machine in the free/paid plan I'm on, making even that approach unreliable?

Just trying to figure out if there's any way to have a same-machine local companion process reachable via localhost, or if that's fundamentally not possible on PythonAnywhere's architecture regardless of how the companion process is started.

Thanks again for your time.

You can run a subprocess from a web app. but you can't start a localhost server there.