CentOS Stream 10: Access to Container Services
Expose container services like HTTP to the host network using port mapping and access them from the host or other containers.
May 25, 2026 • 4 min read
centoscentos-stream-10podmancontainersport-mapping
Expose services running inside containers to the host network using port mapping.
Run a Container with Port Mapping
Run a container with httpd and map host port 8081 to container port 80:
podman run -dt -p 8081:80 srv.world/centos-httpd /usr/sbin/httpd -D FOREGROUND
Verify the container is running:
podman ps
Create a Test Page
podman exec [CONTAINER_ID] /bin/bash -c 'echo "httpd on Podman Container" > /var/www/html/index.html'
Firewalld Configuration
If firewalld is active, edit /etc/firewalld/firewalld.conf and set:
StrictForwardPorts=no
Then restart firewalld:
systemctl restart firewalld
Test Access
Test via the mapped host port:
curl localhost:8081
Test via the container IP directly:
podman inspect -l | grep IPAddress
curl 10.88.0.10