Publishing Commands#

Publish layers from various data sources to GeoServer. The publishing commands handle the complete workflow from data source to published layer.

Available Publishers#

PostGIS Publisher#

Publish vector layers from PostGIS spatial databases.

File Publisher#

Publish layers from files using GeoServer Importer extension.

Common Features#

All publishing commands support:

  • Dry Run: Preview what would be published without making changes
  • Idempotency: Existing layers are automatically skipped
  • Concurrency: Parallel publishing for better performance
  • Workspace Selection: Specify target workspace

Workflow#

  1. Prepare Data Source: Ensure your data source is accessible
  2. Configure Datastore: Create or verify datastore exists (PostGIS publisher creates automatically)
  3. Select Resources: Choose specific resources or use filters
  4. Publish: Create feature types/layers in GeoServer
  5. Configure Layers: Set styles, enable, and advertise layers

Examples#

PostGIS Publishing#

1
2
3
4
5
6
7
8
# Publish all spatial tables
./geoserver-cli publish postgis --all -w my_workspace

# Publish specific tables
./geoserver-cli publish postgis --layers roads,buildings -w my_workspace

# Dry run first
./geoserver-cli publish postgis --all -w my_workspace --dry-run

File Import#

1
2
3
4
5
# Import Shapefile
./geoserver-cli publish file --file data.shp.zip -w my_workspace

# Import GeoTIFF
./geoserver-cli publish file --file raster.tif -w my_workspace

See Also#