Back to articles
Technology Insight

Building a Lightweight APM System: How to Replace New Relic with SigNoz on a 4GB RAM VPS

June 4, 2026

Introduction: The Growing Burden of Observability Costs

In the modern software development lifecycle, Application Performance Monitoring (APM) is no longer a luxury—it is an absolute necessity. Organizations rely on APM tools to track latency, catch exceptions, analyze logs, and guarantee a seamless user experience. However, as infrastructure scales, the cost of proprietary SaaS observability platforms like New Relic, Datadog, or Dynatrace can quickly skyrocket, occasionally even surpassing the cost of the underlying compute infrastructure itself.

For startups, small-to-medium enterprises (SMEs), and independent developers, these pricing models present a major roadblock. Fortunately, the open-source ecosystem has matured significantly. Today, it is entirely feasible to build a robust, comprehensive, and highly efficient APM system on a single, budget-friendly Virtual Private Server (VPS) with just 4GB of RAM. The secret weapon? SigNoz.

This technical guide will walk you through the architecture, prerequisites, step-by-step deployment, and optimization strategies required to replace New Relic with a self-hosted SigNoz instance on resource-constrained hardware.

---

Why SigNoz? The Open-Source Answer to New Relic

SigNoz is an open-source APM tool that provides an integrated user experience for three critical pillars of observability: Metrics, Traces, and Logs. Built on top of industry-standard open technologies, it serves as a dropped-in replacement for costly SaaS dashboards.

Key Advantages of SigNoz

  • OpenTelemetry Native: SigNoz is built natively on OpenTelemetry (OTel), the CNCF industry standard for framework instrumentation. This means you avoid vendor lock-in completely. If you ever change your backend, your application instrumentation remains exactly the same.
  • ClickHouse Columnar Storage: Unlike older open-source stacks that rely on heavy Elasticsearch clusters, SigNoz uses ClickHouse, an incredibly fast, highly compressed, columnar database. This is the primary reason we can run a full APM suite on a tiny 4GB RAM footprint.
  • Unified Dashboard: Instead of jumping between separate tools for logging, tracing, and metrics, SigNoz offers a single, intuitive web interface heavily inspired by modern SaaS platforms.
---

Prerequisites and System Requirements

While SigNoz is highly optimized, running an APM system on a 4GB RAM VPS requires careful resource management. Before starting, ensure your environment meets these exact specifications:

ComponentMinimum RequirementRecommended Specification
Operating SystemUbuntu 22.04 LTS / 24.04 LTSUbuntu 24.04 LTS (Clean installation)
CPU2 vCPUs2 or 4 vCPUs (Intel/AMD or ARM64)
RAM4GB4GB with active Swap space configured
Storage20GB SSD / NVMe50GB+ NVMe (Depending on data retention)
NetworkPublic IPv4 addressPublic IPv4 with a configured domain/subdomain
Critical Note on Memory: A baseline installation of SigNoz can experience memory spikes during heavy indexing. We strongly recommend configuring a 4GB Swap file on your VPS before proceeding to act as a safety net.
---

Step 1: Preparing Your VPS and Configuring Swap Space

Connect to your clean Ubuntu VPS via SSH. First, update the system packages to their latest versions:

sudo apt update && sudo apt upgrade -y

Next, let's verify and establish a 4GB Swap file. This ensures that if ClickHouse or the OpenTelemetry collector experiences a brief spike in data ingestion, the Linux kernel won't trigger the Out-Of-Memory (OOM) killer to terminate your services.

  1. Check if swap is already configured: sudo swapon --show
  2. If empty, create a 4GB allocation file: sudo fallocate -l 4G /swapfile
  3. Set secure permissions: sudo chmod 600 /swapfile
  4. Format the file as swap space: sudo mkswap /swapfile
  5. Activate the swap: sudo swapon /swapfile
  6. Make it permanent by appending this line to /etc/fstab:
    /swapfile none swap sw 0 0

To verify successful activation, run free -h. You should see 4GB of available memory along with approximately 4GB of swap space.

---

Step 2: Installing Docker and Docker Compose

SigNoz is packaged beautifully into containerized microservices managed via Docker Compose. If Docker is not yet present on your VPS, execute the official installation script:

curl -fsSL [https://get.docker.com](https://get.docker.com) -o get-docker.sh
sudo sh get-docker.sh

Ensure your current user is added to the Docker group to avoid typing sudo for every command, then verify the installation:

sudo usermod -aG docker $USER
docker compose version
---

Step 3: Deploying SigNoz via the Automated Script

The SigNoz maintainers provide a streamlined, production-ready installation script that automatically handles directory setups, configuration files, and container orchestration.

Execute the installer using the following command:

git clone -b main [https://github.com/SigNoz/signoz.git](https://github.com/SigNoz/signoz.git)
cd signoz/deploy/

Run the installation script specifically designed for docker-compose installations:

./install.sh

During the execution, the script will check your environment variables, download the necessary container images (including ClickHouse, the SigNoz Query Service, the Frontend UI, and the OpenTelemetry Collector), and boot up the system. This process usually takes 3 to 5 minutes depending on your VPS network speed.

Once completed, you will be greeted with a success message showing that SigNoz is running on port 3301.

---

Step 4: Configuring a Secure Reverse Proxy with Caddy

Exposing port 3301 directly to the open internet is insecure. To protect your data and access the dashboard safely over HTTPS, we will use Caddy Server as a lightweight reverse proxy that automatically provisions SSL certificates from Let's Encrypt.

Install Caddy on your Ubuntu host:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf '[https://dl.cloudsmith.io/public/caddy/stable/gpg.key](https://dl.cloudsmith.io/public/caddy/stable/gpg.key)' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf '[https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt](https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt)' | sudo tee /etc/apt/sources.list.p/caddy-stable.list
sudo apt update
sudo apt install caddy

Configure your domain by editing the Caddyfile located at /etc/caddy/Caddyfile:

apm.yourdomain.com {
    reverse_proxy 127.0.0.1:3301
}

Restart Caddy to apply changes: sudo systemctl restart caddy. You can now securely navigate to [https://apm.yourdomain.com](https://apm.yourdomain.com) to create your administrative account.

---

Step 5: Resource Optimization for 4GB VPS Hardware

To guarantee that your SigNoz instance remains ultra-lightweight and stable over weeks of continuous operation, we need to apply strict optimization parameters to ClickHouse and OpenTelemetry data retention.

1. Limit Data Retention

By default, SigNoz retains metrics and traces for an extended duration. On a 4GB VPS, storage can quickly fill up, leading to high disk I/O which slows down the entire system. Navigate to Settings > General within the SigNoz UI and set your TTL (Time To Live) variables to:

  • Traces Retention: 3 Days
  • Logs Retention: 5 Days
  • Metrics Retention: 7 Days

2. Optimize ClickHouse Memory Consumption

Open the file signoz/deploy/docker/clickhouse-config/config.xml and ensure the max memory usage per query is restricted so that a massive dashboard load does not crash the server. Add or modify the following XML configuration properties:

0.5
2000000000

This strictly forces ClickHouse to use a maximum of 50% of your available physical RAM, leaving the rest safely accessible to the web UI and OS operations.

---

Step 6: Connecting an Application (Replacing New Relic)

Transitioning from New Relic to SigNoz requires shifting from proprietary agents to standard OpenTelemetry SDKs. Let us look at a simple example of how to instrument a Node.js / Express application to send data directly to our new SigNoz server.

First, install the required OpenTelemetry packages in your application repository:

npm install --save @opentelemetry/api @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node @opentelemetry/exporter-trace-otlp-grpc

Create an initialization file named tracer.js that runs before your primary application logic:

const { NodeSDK } = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc');

const sdk = new NodeSDK({
  traceExporter: new OTLPTraceExporter({
    url: 'http://:4317', // OpenTelemetry gRPC endpoint
  }),
  instrumentations: [getNodeAutoInstrumentations()],
});

sdk.start();
console.log("OpenTelemetry Instrumentation Active");

Run your application incorporating the tracer script: node -r ./tracer.js index.js. Within moments, your application performance metrics, HTTP request traces, and latency charts will begin cascading live into your self-hosted SigNoz dashboard.

---

Conclusion: Enterprise Capabilities at a Fraction of the Cost

By leveraging SigNoz and ClickHouse, we have successfully engineered a self-hosted, feature-complete APM platform capable of replacing New Relic, operating comfortably within a compact 4GB RAM VPS footprint. You get deep contextual visibility into your distributed software systems, highly detailed flamegraphs, and robust log aggregation without getting trapped under an unpredictable SaaS billing structure.

As your software expands, scaling this architecture is as simple as resizing your cloud VPS instance or detaching ClickHouse to a dedicated volume. You are now entirely in control of your own observability metrics.