Skip to main content

Prerequisites

Before you begin, ensure you have:
  • Node.js 18.x or higher (the backend requires Node.js)
  • npm 11.x or higher (comes with Node.js)
  • Git for cloning the repository
  • Active Directory domain controller (optional if using simulation mode)
  • RD Connection Broker (optional if using simulation mode)
New to RDS? You can start with simulation mode to explore the interface without requiring AD or RDCB infrastructure.

Installation

1

Clone the repository

Clone the RDSWeb Custom source code to your local machine:
git clone <your-repository-url>
cd rdsweb-custom
2

Install backend dependencies

Navigate to the backend directory and install dependencies:
cd backend
npm install
This installs the required packages including Express.js, JWT libraries, and AD authentication modules.
3

Configure the backend

Copy the example environment file and customize it for your environment:
cp .env.example .env
Edit .env with your configuration:
backend/.env
# Server Configuration
PORT=3000
NODE_ENV=development

# JWT Settings
JWT_SECRET=your_very_long_random_secret_here
JWT_EXPIRES_IN=8h

# Active Directory Configuration
LDAP_URL=ldap://dc01.yourdomain.local
LDAP_BASE_DN=DC=yourdomain,DC=local
AD_DOMAIN=YOURDOMAIN

# Service Account (read-only permissions)
AD_SERVICE_USER=[email protected]
AD_SERVICE_PASS=YourServiceAccountPassword

# RD Connection Broker
RDCB_SERVER=rdcb.yourdomain.local

# RD Gateway
RDGATEWAY_HOSTNAME=rdgateway.yourdomain.local

# Simulation Mode (set to false for production)
SIMULATION_MODE=true
SIMULATION_USER=testuser
SIMULATION_PASS=TestPass123!
Security: Never commit the .env file to version control. It contains sensitive credentials.
4

Start the backend server

Launch the Express.js API server:
npm start
For development with auto-reload:
npm run dev
You should see output indicating the server is running:
╔══════════════════════════════════════╗
║       RDWeb-Moderno  Backend         ║
║   Servidor en puerto 3000            ║
║   Modo: SIMULACIÓN 🟡                ║
║   RDCB: SRV-APPS.LAB-MH.LOCAL        ║
╚══════════════════════════════════════╝

API Health: http://localhost:3000/api/health
5

Install frontend dependencies

Open a new terminal, navigate to the frontend directory, and install dependencies:
cd frontend
npm install
This installs Angular 21, Angular Material, and all required dependencies.
6

Start the frontend development server

Launch the Angular development server:
npm start
Or explicitly with Angular CLI:
ng serve
The frontend will be available at http://localhost:4200
7

Access the application

Open your browser and navigate to:
http://localhost:4200
If using simulation mode, log in with:
  • Username: The value of SIMULATION_USER from your .env file
  • Password: The value of SIMULATION_PASS from your .env file

Verify Installation

Once both servers are running, verify everything is working:

Check Backend Health

Visit the health check endpoint:
curl http://localhost:3000/api/health
You should receive a response like:
{
  "status": "ok",
  "simulationMode": true,
  "rdcbServer": "SRV-APPS.LAB-MH.LOCAL",
  "timestamp": "2026-03-04T10:30:00.000Z"
}

Test Authentication

Test the login endpoint (simulation mode):
curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "testuser",
    "password": "TestPass123!",
    "privateMode": false
  }'
Successful authentication returns user details and sets an HTTP-only cookie.

Configuration Options

Simulation vs. Production Mode

Use for: Development, testing, demos
SIMULATION_MODE=true
SIMULATION_USER=testuser
SIMULATION_PASS=TestPass123!
In simulation mode:
  • No Active Directory connection required
  • No RD Connection Broker required
  • Returns mock RemoteApp data
  • Perfect for frontend development and testing

Session Timeout Settings

The application supports two session modes:
  • Standard Mode: 20-minute session timeout
  • Private Mode: 240-minute (4-hour) session timeout
Users can select private mode during login. This setting affects:
  • JWT token expiration (backend/src/routes/auth.js:30)
  • Cookie max-age (backend/src/routes/auth.js:35)
  • RDP session timeout (backend/src/services/rdpService.js:14)

CORS Configuration

By default, the backend accepts requests from:
  • http://localhost:4200 (Angular default port)
  • http://localhost:4300 (alternative port)
To add additional origins, edit backend/src/index.js:21:
cors({
    origin: ['http://localhost:4200', 'https://rdweb.yourdomain.com'],
    credentials: true,
    methods: ['GET', 'POST', 'OPTIONS'],
    allowedHeaders: ['Content-Type', 'Authorization'],
})

Building for Production

Backend

The backend runs directly with Node.js:
cd backend
NODE_ENV=production npm start
For production deployments, consider:
  • Using a process manager like PM2 or systemd
  • Running behind a reverse proxy (nginx, Apache)
  • Enabling HTTPS with proper certificates

Frontend

Build the Angular application for production:
cd frontend
npm run build
This creates optimized static files in frontend/dist/. Serve these files with:
  • Nginx or Apache
  • Azure Static Web Apps
  • AWS S3 + CloudFront
  • Any static hosting service
API Endpoint: Update the frontend’s API endpoint configuration in frontend/src/environments/environment.prod.ts to point to your production backend URL.

Troubleshooting

If you see LDAP connection errors:
  1. Verify your Domain Controller is reachable: ping dc01.yourdomain.local
  2. Check LDAP port is open: telnet dc01.yourdomain.local 389
  3. Verify service account credentials in .env
  4. Temporarily enable SIMULATION_MODE=true to isolate the issue
If you see CORS or connection errors:
  1. Verify backend is running: curl http://localhost:3000/api/health
  2. Check the frontend API URL in frontend/src/environments/environment.ts
  3. Ensure CORS origins in backend/src/index.js include your frontend URL
  4. Check browser console for specific error messages
If users can log in but see no RemoteApps:
  1. Verify RDCB_SERVER in .env points to your Connection Broker
  2. Check network connectivity to the RDCB server
  3. Ensure the user has RemoteApp permissions in AD groups
  4. Review backend logs for RDCB connection errors
  5. Test with SIMULATION_MODE=true to see mock apps
If .rdp files are generated but fail to connect:
  1. Open the .rdp file in a text editor and verify server addresses
  2. Check RDGATEWAY_HOSTNAME is correct and reachable
  3. Ensure RD Gateway is properly configured
  4. Verify the user has permissions to access the RemoteApp
  5. Test connectivity to the RD Gateway: telnet rdgateway.yourdomain.local 443

Next Steps

Now that you have RDSWeb Custom running:

Configure Active Directory

Set up AD service accounts and group permissions

Learn About Features

Explore authentication, RemoteApp catalog, and more

Deploy to Production

Learn how to deploy securely to your environment

API Reference

Explore the backend API endpoints

Build docs developers (and LLMs) love