After deploying a service, I would like to manually open a port in that service. Is there a way to do this manually?

I know expose will open a port, but I would like to manually open a different port.


You can do this in juju as a round about way. Juju provides a juju run command which allows execution of commands against a remote Juju unit.

So, for example, if you have an application deployed called foo, with the unit foo/0 you could do the following:

juju run --unit foo/0 "open-port 8000"

Replacing 8000 with whichever port you need. There are a plethora of hook-tools you can invoke in addition to standard commands like whoami.

For that list you can run juju help-tool and for more information on each tool juju help-tool open-port.

I'd also make sure you file a bug against the charm if that port is supposed to be open but is not.


It's probably iptables -I INPUT -p tcp -m tcp --dport port_number_here -j ACCEPT.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.