localhost:4848 — GlassFish Admin Console

Port 4848 is the administration console for GlassFish Server — the reference implementation of Jakarta EE (formerly Java EE). If you're doing enterprise Java development and deploying to GlassFish, this is where you manage the server: deploy applications, configure database connections, set up security, monitor resources, and manage the server lifecycle.

GlassFish listens on two ports: 8080 for your deployed web applications (the user-facing side) and 4848 for the admin console (the server management side). They're separate services — 8080 is what users see, 4848 is what developers and sysadmins use.

Admin Console: localhost:4848

GlassFish in 2026

A bit of context: Oracle open-sourced GlassFish and transferred it to the Eclipse Foundation, where it's now called Eclipse GlassFish. It's still the reference implementation for Jakarta EE, but in production environments, most teams use Payara (a commercially supported GlassFish fork), WildFly (Red Hat), or embedded servers like the one in Spring Boot. GlassFish remains important for development and certification testing.

Starting GlassFish

# Start the default domain
asadmin start-domain

# Start a specific domain
asadmin start-domain domain1

# Check status
asadmin list-domains

# Output: domain1 running
# Admin console: http://localhost:4848
# Applications: http://localhost:8080

What You Can Do in the Admin Console

Deploy Applications — Upload WAR, EAR, or JAR files through the web interface. Go to Applications → Deploy, browse to your file, and click OK. Or use the command line: asadmin deploy myapp.war

JDBC Connection Pools — Configure database connections under Resources → JDBC → Connection Pools. You define the database driver, URL, username, and password here. Then create a JDBC Resource that your application references via JNDI lookup.

JMS Resources — Set up Java Message Service queues and topics for asynchronous messaging between application components.

Security Configuration — Manage security realms, SSL certificates, and authentication providers under Configurations → Security.

Server Monitoring — View JVM memory usage, thread pools, HTTP listeners, and request statistics. Useful for diagnosing performance issues.

Setting Up a Database Connection

# Via command line (example for PostgreSQL)
# 1. Add the JDBC driver JAR to GlassFish
cp postgresql-42.7.jar glassfish/domains/domain1/lib/

# 2. Restart GlassFish
asadmin restart-domain

# 3. Create connection pool
asadmin create-jdbc-connection-pool \
  --datasourceclassname org.postgresql.ds.PGSimpleDataSource \
  --restype javax.sql.DataSource \
  --property user=postgres:password=secret:databaseName=mydb:serverName=localhost:portNumber=5432 \
  MyPool

# 4. Create JDBC resource
asadmin create-jdbc-resource --connectionpoolid MyPool jdbc/mydb

# 5. Ping to test
asadmin ping-connection-pool MyPool

Troubleshooting

4848 won't load: GlassFish domain isn't running. Start it with asadmin start-domain. Check the domain log at glassfish/domains/domain1/logs/server.log for startup errors.

Admin login doesn't work: On first install, the default is username admin with an empty password. If you set a password and forgot it, you can reset it by editing domains/domain1/config/admin-keyfile.

Port 4848 conflict: Another service is using 4848. Change GlassFish's admin port: asadmin set server.network-config.network-listeners.network-listener.admin-listener.port=4849

Applications deploy but show 404: Check the context root. By default, myapp.war deploys to http://localhost:8080/myapp. If you want it at the root, deploy with --contextroot /.