Development Server
Run a local development server with aer server to preview Lightning Web Components, explore your application architecture, test API integrations, and inspect platform events—all without deploying to an org.
Start the server
aer server force-app/main/defaultThe command loads Apex classes, triggers, flows, LWC, and object metadata from the specified paths. By default the server listens on http://127.0.0.1:8080.
Add --watch to automatically reload changed Apex and LWC files:
aer server force-app/main/default --watchPress Ctrl+C to stop the server.
Local LWC preview
Open http://127.0.0.1:8080/dev/lwc in your browser to see a list of available Lightning Web Components. Click any component to render it in an isolated preview. The preview page injects mock @wire data and lets you interact with the component as if it were running in a Salesforce environment.
Combine --watch with LWC preview for a fast feedback loop:
- Start the server with
--watch. - Open a component preview in your browser.
- Edit the component’s HTML, JavaScript, or CSS.
- Save the file—the server reloads and the browser reflects changes.
LWC preview supports:
@apiproperties with editable inputs@wireadapters backed by local Apex and schema- Component composition and slots
- Lightning base components
The Explorer
Navigate to http://127.0.0.1:8080/dev/explorer to browse the application architecture exposed by your source paths and loaded packages. The Explorer displays:
- Objects: Standard and custom objects with their fields, relationships, and picklist values
- Apex Classes: Methods and signatures, call graphs showing which methods call which, interface implementations, and class inheritance hierarchies
- Flows: Flow definitions with entry points and variables
- Custom Metadata: Custom metadata type records
Use the Explorer to verify that your local environment matches expectations before writing Apex tests or integration code.
API endpoints
The server exposes Salesforce-compatible REST and SOAP API endpoints. Point external tools, scripts, or integration tests at the local server instead of a Salesforce org.
Authentication
Connect to the local server using the Salesforce CLI:
$ sf org login web -r http://127.0.0.1:8080 -a aer
Successfully authorized admin@aer.local with org ID 00D000000000000The default credentials are:
- Username:
admin@aer.local(override with--username) - Password:
password(override with--password)
REST API examples
Create a record:
$ sf data create record -s Account -v "Name='Acme'" -o aer
Successfully created record: 001aer000000001AAA.
Creating record for Account... doneQuery records:
$ sf data query -q "SELECT Id, Name FROM Account" -o aer
┌────────────────────┬──────┐
│ ID │ NAME │
├────────────────────┼──────┤
│ 001aer000000001AAA │ Acme │
└────────────────────┴──────┘
Total number of records retrieved: 1.
Querying Data... doneCall Apex REST:
sf apex run rest -m GET -u /services/apexrest/MyService -o aerThe server supports composite requests, batch requests, and the SObject Collections API for bulk operations.
Event Viewer
The Event Viewer at http://127.0.0.1:8080/dev/events displays platform events and deliveries during the session. Use it to verify that your code publishes events correctly and that subscribers receive them before deploying to an org.
Publishing events
Events can be published through:
- Apex (
EventBus.publish()) - REST API
- Pub/Sub API (gRPC)
Subscribing to events
Subscriptions are supported through:
- Pub/Sub API (gRPC)
- CometD Streaming API
- Apex triggers
- LWC Emp API
Integration testing with events
- Start the server and open the Event Viewer in your browser.
- Publish events via Apex, REST, or Pub/Sub API.
- Watch events and deliveries appear in real time.
# Start the server
aer server force-app/main/default &
# Authenticate
sf org login web -r http://127.0.0.1:8080 -a aer
# Publish a platform event
sf data create record -s OrderStatusChange__e -v "Status__c='Completed'" -o aer
# Verify the event was published and delivered via the Event ViewerTips
- Use
--sandboxto setOrganization.IsSandboxtotruefor code that checks the environment. - Load managed packages with
--packageor--package-dirto test integrations with third-party apps. - Use
--allow-calloutsto allow the server to make real HTTP callouts. - Use
--wiremockto mock HTTP callouts with WireMock stubs (works with or without--allow-callouts). - Assign permission sets to the default user with
-p PermissionSetNamefor permission-aware testing.