1 import { Table } from "docs-ui"
2
3 export const metadata = {
4 title: `Cloud vs Self-Hosting`,
5 }
6
7 # {metadata.title}
8
9 In this guide, you'll learn about the main differences between hosting your Medusa application on Cloud and self-hosting it. By the end of this guide, you'll be able to make an informed decision about which option is best for your use case.
10
11 ## What is Self-Hosting?
12
13 Self-hosting means deploying and managing your Medusa application on your own infrastructure or a hosting provider of your choice, such as AWS, Railway, or DigitalOcean.
14
15 Developers with infrastructure management experience may consider self-hosting their Medusa application to have greater control over their deployment environment and potentially reduce costs.
16
17 However, before choosing self-hosting, it's important to understand the challenges that come with it, the efforts it requires, and whether Cloud can provide a better solution for your needs.
18
19 ---
20
21 ## Summary
22
23 <Table>
24 <Table.Header>
25 <Table.Row>
26 <Table.HeaderCell>
27 Concern
28 </Table.HeaderCell>
29 <Table.HeaderCell>
30 Self-Hosting
31 </Table.HeaderCell>
32 <Table.HeaderCell>
33 Cloud
34 </Table.HeaderCell>
35 </Table.Row>
36 </Table.Header>
37 <Table.Body>
38 <Table.Row>
39 <Table.Cell>
40 [AI-Native Platform](#ai-native-platform)
41 </Table.Cell>
42 <Table.Cell>
43 Lack of tools with context on your project and expertise in Medusa to help you build and maintain your application.
44 </Table.Cell>
45 <Table.Cell>
46 Empower your agentic workflows with context and expertise on Medusa with MCP servers, skills, CLI tools, and more.
47 </Table.Cell>
48 </Table.Row>
49 <Table.Row>
50 <Table.Cell>
51 [Code Ownership](#code-ownership)
52 </Table.Cell>
53 <Table.Cell>
54 You own and manage your Medusa application code.
55 </Table.Cell>
56 <Table.Cell>
57 You own and manage your Medusa application code.
58 </Table.Cell>
59 </Table.Row>
60 <Table.Row>
61 <Table.Cell>
62 [Configurations](#configurations)
63 </Table.Cell>
64 <Table.Cell>
65 Requires manual configuration of servers, databases, and other services.
66 </Table.Cell>
67 <Table.Cell>
68 Provides pre-configured environments, reducing setup time.
69 </Table.Cell>
70 </Table.Row>
71 <Table.Row>
72 <Table.Cell>
73 [Deployment & Production Readiness](#deployment--production-readiness)
74 </Table.Cell>
75 <Table.Cell>
76 Requires complex setup of the deployment environment and ensuring production readiness.
77 </Table.Cell>
78 <Table.Cell>
79 Provides automated deployment and scaling, making it easier to manage production environments.
80 </Table.Cell>
81 </Table.Row>
82 <Table.Row>
83 <Table.Cell>
84 [Auto-Scaling](#auto-scaling)
85 </Table.Cell>
86 <Table.Cell>
87 Requires manual setup and management of scaling policies and infrastructure.
88 </Table.Cell>
89 <Table.Cell>
90 Automatically scales based on traffic, ensuring optimal performance.
91 </Table.Cell>
92 </Table.Row>
93 <Table.Row>
94 <Table.Cell>
95 [High-Availability](#high-availability)
96 </Table.Cell>
97 <Table.Cell>
98 Requires manual setup and management of redundancy and failover mechanisms.
99 </Table.Cell>
100 <Table.Cell>
101 Provides real-time monitoring and failover mechanisms to ensure high availability.
102 </Table.Cell>
103 </Table.Row>
104 <Table.Row>
105 <Table.Cell>
106 [Performance](#performance)
107 </Table.Cell>
108 <Table.Cell>
109 Requires manual optimization and monitoring to ensure optimal performance.
110 </Table.Cell>
111 <Table.Cell>
112 Provides continuous performance monitoring and optimization, with built-in cacheing support.
113 </Table.Cell>
114 </Table.Row>
115 <Table.Row>
116 <Table.Cell>
117 [Developer Experience](#developer-experience)
118 </Table.Cell>
119 <Table.Cell>
120 Limited developer experience due to the lack of features like code previews and staging environments.
121 </Table.Cell>
122 <Table.Cell>
123 Offers GitHub integration, preview and staging environments, and push-to-deploy features, enhancing developer experience and productivity.
124 </Table.Cell>
125 </Table.Row>
126 <Table.Row>
127 <Table.Cell>
128 [Storefront](#storefront)
129 </Table.Cell>
130 <Table.Cell>
131 Requires separate deployment and manual configuration to connect to the backend.
132 </Table.Cell>
133 <Table.Cell>
134 Deploy storefront alongside your backend with zero configuration and automatic environment setup.
135 </Table.Cell>
136 </Table.Row>
137 <Table.Row>
138 <Table.Cell>
139 [Email](#email)
140 </Table.Cell>
141 <Table.Cell>
142 Requires setting up and managing your own email infrastructure or third-party service.
143 </Table.Cell>
144 <Table.Cell>
145 Built-in email sending service with monitoring and domain verification.
146 </Table.Cell>
147 </Table.Row>
148 <Table.Row>
149 <Table.Cell>
150 [Data Backup](#data-backup)
151 </Table.Cell>
152 <Table.Cell>
153 Requires manual setup of reliable data backup and recovery processes.
154 </Table.Cell>
155 <Table.Cell>
156 Provides automated backups and recovery options based on your plan.
157 </Table.Cell>
158 </Table.Row>
159 <Table.Row>
160 <Table.Cell>
161 [Support](#support)
162 </Table.Cell>
163 <Table.Cell>
164 Relies on community support and documentation.
165 </Table.Cell>
166 <Table.Cell>
167 Offers dedicated support, ensuring timely assistance.
168 </Table.Cell>
169 </Table.Row>
170 <Table.Row>
171 <Table.Cell>
172 [Cost](#cost)
173 </Table.Cell>
174 <Table.Cell>
175 Complex pricing and often expensive as you scale.
176 </Table.Cell>
177 <Table.Cell>
178 Transparent plans with competitive pricing.
179 </Table.Cell>
180 </Table.Row>
181 </Table.Body>
182 </Table>
183
184 ## AI-Native Platform
185
186 When you self-host your Medusa application, you lack access to AI-native tools with expertise in Medusa to help you build and maintain your application. Custom feature development takes more time and effort, and troubleshooting issues can be more complex and time-consuming.
187
188 With Cloud, you get access to AI-native tools that empower your agentic workflows with built-in Medusa and deployment knowledge:
189
190 1. [Docs MCP server](!docs!/learn/introduction/build-with-llms-ai/docs-mcp-server) for efficient development with AI agents.
191 2. [Cloud CLI](../cli/page.mdx) tools to manage your Cloud resources and debug issues with AI agents like Claude Code.
192 3. [Fix with AI](../deployments/fix-with-ai/page.mdx) feature to troubleshoot and resolve build and deployment issues with the help of the [Cloud Assistant](../assistant/page.mdx).
193 4. [Agentic skills](!docs!/learn/introduction/build-with-llms-ai/agentic-skills) to give your AI agent the Medusa expertise it needs to help you build and maintain your application.
194
195 By using Cloud, you can leverage these AI-native tools to enhance your development workflow and reduce the time to go live. You can also troubleshoot and resolve issues more efficiently, ensuring your application runs smoothly and reliably.
196
197 ---
198
199 ## Code Ownership
200
201 Both self-hosting and Cloud allow you to own and manage your Medusa application codebase.
202
203 When you deploy your Medusa application on Cloud, you deploy it from your own GitHub repository. The code remains entirely yours. Cloud only manages the deployment and hosting of your application.
204
205 ---
206
207 ## Configurations
208
209 ### Self-Hosting: Manual Configurations
210
211 When you **self-host**, you must manually configure the server for production. You also need to configure database connections, storefront hosting, email services, event services, locking mechanisms, and other [Infrastructure Modules](!resources!/infrastructure-modules) that your Medusa application may use.
212
213 There may also be platform-specific configurations, adding another layer of complexity that will slow down your time to launch. You'll also need to maintain these configurations over time as Medusa updates are released.
214
215 ### Cloud: Pre-configured Environments
216
217 On **Cloud**, Medusa offers:
218
219 - Pre-configured environments optimized for Medusa applications with no configuration required on your end.
220 - Automated setup and management of infrastructure components.
221 Integrated services like [PostgreSQL](../database/page.mdx), [Redis](../redis/page.mdx), [S3](../s3/page.mdx), and [Medusa Emails](../emails/page.mdx) that work out-of-the-box.
222 - [Storefront deployment](../storefront/page.mdx) alongside your Medusa application with zero configuration and automatic environment setup.
223
224 All of these features are available out-of-the-box in your Cloud projects. By using Cloud, you can reduce the time and effort required to get your application up and running, allowing you to focus on building and shipping features.
225
226 ---
227
228 ## Deployment & Production Readiness
229
230 ### Self-Hosting: Complex and Time-Consuming Setup
231
232 When you **self-host**, you need to manually set up the production environment, including scaling, monitoring, and logging. You'll need to build deployment pipelines and processes to ensure smooth deployments and rollbacks.
233
234 Additionally, your self-hosted environment must be production-ready with best security practices, performance optimizations, and high-availability configurations.
235
236 Supporting this setup requires extensive knowledge of infrastructure management. You must also dedicate time and resources to maintain the infrastructure.
237
238 ### Cloud: Automated Deployment
239
240 On **Cloud**, Medusa manages your deployment environment and ensures it's optimized for production. Medusa:
241
242 - Handles scaling automatically based on your traffic. More information in the [Auto-Scaling](#auto-scaling) section.
243 - Rolls out your code updates with zero downtime, ensuring a smooth experience for your users.
244 - Provides [logging](../logs/page.mdx) features to track your application's performance without additional setup.
245
246 ---
247
248 ## Auto-Scaling
249
250 ### Self-Hosting: Manual Setup and Management
251
252 Auto-scaling is essential to maintain performance and availability during high traffic periods, such as sales or promotions.
253
254 When you **self-host**, you must set up and manage scaling policies and infrastructure manually. You must configure load balancers, auto-scaling groups, and monitoring tools to ensure your application can handle traffic spikes.
255
256 If not set up correctly, your application may experience performance degradation or downtime during high traffic periods.
257
258 ### Cloud: Automatic Scaling
259
260 On **Cloud**, Medusa automatically scales your application based on traffic. This ensures optimal performance without manual intervention.
261
262 Medusa adjusts the number of instances running your application based on demand, ensuring your users have a seamless experience even during traffic spikes. You don't need to configure or manage any scaling policies or infrastructure, as Medusa handles everything for you.
263
264 ---
265
266 ## High-Availability
267
268 ### Self-Hosting: Risk of Downtime
269
270 When you **self-host**, you are responsible for setting up and managing redundancy and failover mechanisms to ensure high availability. You must monitor your application's health and respond to incidents manually.
271
272 If your infrastructure fails and you don't have proper failover mechanisms in place, your application may experience downtime, leading to a poor user experience.
273
274 ### Cloud: Highly Reliable with 24/7 Monitoring
275
276 Medusa provides high-availability features on **Cloud** to ensure your application remains online and responsive. Medusa:
277
278 - Monitors your application's health 24/7 and automatically responds to incidents.
279 - Implements failover mechanisms to minimize downtime and ensures your application is always available.
280 - Offers [SLA-backed response and uptime](../pricing/page.mdx) based on your plan to guarantee your application's availability.
281
282 By using Cloud, you can focus on building your application without worrying about downtime or availability issues.
283
284 ---
285
286 ## Performance
287
288 ### Self-Hosting: Manual Optimization
289
290 When you **self-host**, you are responsible for optimizing and monitoring your application's performance. You must configure caching mechanisms, database optimizations, and other performance-enhancing techniques.
291
292 If not optimized correctly, your application may experience slow response times, leading to a poor user experience.
293
294 ### Cloud: Continuous Performance Monitoring
295
296 Medusa provides continuous performance monitoring and optimization on **Cloud**. Medusa continuously monitors applications to identify performance bottlenecks and build tooling to resolve them. Medusa also provides a direct [cache](../cache/page.mdx) integration to [improve performance of business-critical APIs](../cache/page.mdx#performance-benchmark-comparisons).
297
298 Cloud users benefit from these optimizations without any additional effort or configuration, ensuring their applications run smoothly and efficiently.
299
300 ---
301
302 ## Developer Experience
303
304 ### Self-Hosting: Slower Developer Experience
305
306 When you **self-host**, you may miss out on features like code previews and push-to-deploy, making it difficult to review and ship changes quickly.
307
308 You'll also find it challenging to reproduce production issues, as you'll need to set up staging environments manually, adding to the complexity.
309
310 ### Cloud: Enhanced Developer Experience
311
312 Medusa enhances the developer experience on **Cloud** by providing features like:
313
314 - GitHub integration for [push-to-deploy](../deployments/page.mdx#how-are-deployments-created).
315 - [Preview environments](../environments/preview/page.mdx) to test changes in pull requests before merging.
316 - [Staging environments](../environments/page.mdx) to test new features and reproduce issues in a production-like setting.
317 - [Storefront deployment](../storefront/page.mdx) alongside your Medusa application with aligned configurations across environments. You can preview changes in your storefront while previewing backend changes.
318
319 By using Cloud, you streamline your development workflow and reduce the time and effort required to manage and ship features.
320
321 ---
322
323 ## Storefront
324
325 ### Self-Hosting: Separate Deployment and Manual Configuration
326
327 When you **self-host**, you need to deploy your storefront separately from your Medusa application. This requires:
328
329 - Setting up a separate hosting environment for your frontend in a separate provider like Vercel or Netlify.
330 - Manually configuring URLs, API keys, and CORS settings to connect the storefront to the backend.
331 - Managing different deployments for each environment (production, staging, previews), and ensuring they connect to the correct backend instances.
332 - Setting up SSL certificates and custom domains independently.
333 - Configuring CDN and performance optimizations manually.
334
335 This separation adds complexity and increases the chances of configuration errors that can affect your application's functionality. Without proper configuration, you may compromise on developer experience as you won't have integrated previews or staging environments.
336
337 ### Cloud: End-to-End Deployment with Zero Configuration
338
339 On **Cloud**, Medusa allows you to deploy your [storefront](../storefront/page.mdx) alongside your Medusa application, enabling you to host and manage both backend and frontend in a single platform. Medusa provides:
340
341 - **Zero-configuration deployment**: Automatically configures URLs, API keys, and CORS settings to ensure seamless connectivity between your storefront and backend.
342 - **Environment-specific storefronts**: Deploys separate storefront instances for production, staging, and preview environments, with each automatically connected to the corresponding backend.
343 - **Framework agnostic**: [supports various frontend frameworks](../storefront/page.mdx#supported-storefront-frameworks) like Next.js and Tanstack Start.
344 - **Custom domains and SSL**: Set up custom domains with automatically provisioned and renewed SSL certificates.
345 - **Global CDN**: Storefronts are served via a global Content Delivery Network, ensuring fast load times for customers worldwide.
346
347 By using Cloud's storefront hosting, you reduce deployment complexity and ensure all components of your commerce application work together seamlessly. You also enhance the developer experience with integrated previews and staging environments.
348
349 ---
350
351 ## Email
352
353 ### Self-Hosting: Complex Email Infrastructure Setup
354
355 When you **self-host**, sending transactional and marketing emails requires:
356
357 - Setting up and managing your own email infrastructure or integrating a third-party email service provider.
358 - Manually configuring notification module providers like SendGrid, Mailgun, or AWS SES.
359 - Managing email authentication records (SPF, DKIM, DMARC) in your DNS settings.
360 - Monitoring email deliverability, open rates, and bounce rates manually or through separate analytics tools.
361 - Handling email sending limits and managing costs as your volume grows.
362 - Troubleshooting delivery issues without built-in monitoring tools.
363
364 This setup requires technical expertise and ongoing maintenance to ensure reliable email delivery.
365
366 ### Cloud: Built-in Email Service with Zero Configuration
367
368 On **Cloud**, Medusa provides [Medusa Emails](../emails/page.mdx), a built-in email sending service that works out-of-the-box with zero configuration. Medusa Emails offers:
369
370 - **Instant setup**: Available by default for all Cloud projects without manual configuration or provider setup.
371 - **Email monitoring**: Track email delivery rates, open rates, click rates, bounce rates, and complaint rates through the Cloud dashboard.
372 - **Domain verification**: Verify your own email sender domains to send emails from branded addresses.
373 - **Organization-wide management**: Monitor email activity across all projects in your organization from a centralized dashboard.
374 - **Detailed email tracking**: View individual email event histories and preview email content as it was sent to recipients.
375 - **Plan-based limits**: Different sending limits based on your [plan](../pricing/page.mdx), with the flexibility to scale as needed.
376
377 By using Medusa Emails, you eliminate the need to set up and manage email infrastructure, allowing you to focus on building and sending effective email communications to your customers.
378
379 ---
380
381 ## Data Backup
382
383 ### Self-Hosting: Risky if Not Done Properly
384
385 When you **self-host**, you need to set up data backup and recovery processes manually. This includes scheduling regular backups, storing them securely, and testing recovery procedures. Failing to implement a robust backup strategy can lead to data loss in the event of errors or disasters.
386
387 ### Cloud: Automated Backups and Recovery
388
389 Medusa provides automated backups and recovery options on **Cloud** based on your [plan](../pricing/page.mdx). Backups are performed reliably and stored securely, reducing the risk of data loss. You can restore your data if needed without affecting your application's availability.
390
391 ---
392
393 ## Support
394
395 ### Self-Hosting: Community Support
396
397 When you **self-host**, you rely on community support and documentation for assistance. While the Medusa community is active and helpful, you may not receive timely responses to critical issues or answers that are specific to your business use case. Limited support may slow down your development and affect your application's reliability.
398
399 ### Cloud: Dedicated Support
400
401 Medusa offers dedicated [support](https://medusajs.com/medusa-support/) options for **Cloud** users based on their [plan](../pricing/page.mdx). You receive timely assistance to help resolve issues, upgrade your application, and improve performance. Medusa provides the necessary resources to maintain and grow your application.
402
403 ---
404
405 ## Cost
406
407 ### Self-Hosting: Variable Costs
408
409 When you **self-host**, your costs vary based on your chosen infrastructure and usage patterns. At minimum, you'll need server and worker instances, a PostgreSQL database, and a Redis instance. You'll likely need additional services like S3 for file storage or monitoring tools.
410
411 Depending on your traffic and usage, costs can add up quickly, especially if the infrastructure isn't optimized for cost efficiency.
412
413 ### Cloud: Cost-Competitive Pricing
414
415 Medusa offers a cost-competitive pricing model on **Cloud** compared to self-hosting. You can choose a [plan](../pricing/page.mdx) that fits your needs and budget, with the flexibility to scale as your application grows.
416
417 ---
418
419 ## Get Started with Cloud
420
421 [Sign Up](../sign-up/page.mdx) on Cloud to get started and deploy your first application in minutes.
422
423 ### Migrate in Two Steps
424
425 If you have an existing self-hosted Medusa application, you can migrate it to Cloud by:
426
427 1. [Creating a project](../projects/page.mdx) and connecting it to your existing GitHub repository.
428 2. [Importing your production database](../database/page.mdx#importexport-cloud-database-dumps) to Cloud.
429
430 You'll then have a fully managed Medusa application deployed on Cloud, with all the benefits mentioned above, including automated deployment, scaling, and enhanced developer experience.