How to Deploy a Next.js App Using and Tigris

Next.js, the React framework known for its server-side rendering and static site generation capabilities, empowers developers to build blazing-fast and SEO-friendly web applications. But once you’ve crafted your masterpiece, it’s time to unleash it on the world. Here’s where and Tigris come in, offering a powerful and seamless deployment solution for your Next.js app. A Platform Built for Speed is a next-generation cloud platform designed for developers who value speed, simplicity, and cost-effectiveness. It boasts a global network of high-performance servers, ensuring your application delivers lightning-fast response times regardless of user location. Additionally, Fly’s unique pay-per-use pricing model means you only pay for the resources you actually consume, making it an attractive option for budget-conscious developers.

Tigris: Object Storage Made Easy

Tigris, seamlessly integrated with, provides a globally distributed object storage service. This means you can store static assets like images, videos, and other media files used by your Next.js app with ease. Tigris offers high availability and scalability, ensuring your assets are readily accessible to users worldwide.

The Benefits of This Powerhouse Combination

Deploying your Next.js app with and Tigris offers a multitude of benefits:

  • Effortless Deployment: streamlines the deployment process. No complex server configurations or infrastructure management are required.
  • Global Reach: Leverage Fly’s global network to ensure low latency and high availability for your users across the globe.
  • Scalability on Demand: Fly’io automatically scales your resources based on traffic, ensuring your application can handle sudden surges without compromising performance.
  • Cost-Effective Solution: Pay-per-use pricing ensures you only pay for the resources your Next.js app consumes, making it ideal for startups and cost-conscious projects.
  • Separation of Concerns: Tigris allows you to manage your static assets separately from your application code, promoting clean architecture and easier maintenance.

Getting Started: A Step-by-Step Guide

Now that you’re convinced of the power of this duo, let’s dive into the deployment process:

1. Setting Up Your Account

If you haven’t already, head over to and create a free account. The signup process is straightforward and requires minimal information.

2. Install Fly CLI (flyctl) provides a powerful command-line tool, flyctl, that simplifies interactions with the platform. Installation instructions for various operating systems are available on the documentation:

3. Create a New Next.js Project (Optional)

If you don’t have a Next.js app ready, you can quickly create one using the official Next.js CLI tool:


npx create-next-app my-nextjs-app

4. Initialize Project

Navigate to your Next.js project directory and run the following command to initialize a project:


flyctl launch

This command will create a fly.toml file in your project’s root directory. This file serves as your application’s configuration for

5. Configure Deployment Settings (Optional)

The generated fly.toml file provides basic configuration options. You can customize it to suit your specific needs. Here are some key points to consider:

  • Environment Variables: Define environment variables that your Next.js app might require for configurations.
  • Build Commands: Specify the commands used to build and optimize your Next.js application for production. will automatically execute these commands before deployment.
  • Scaling: Configure scaling settings to adjust the amount of resources allocated to your application based on traffic.

6. Deploy Your App

Once you’re satisfied with your configuration, it’s time to deploy your Next.js app to Simply execute the following command:


flyctl deploy will take care of building your application, uploading it to their servers, and making it accessible to the world. The command will also provide you with the URL of your deployed application.

7. Connect Your Static Assets with Tigris (Optional)

  • Upload Static Assets: Upload your static assets (images, videos, etc.) to the newly created Tigris bucket. You can use the dashboard or various CLI tools provided by Tigris for uploading.
  • Configure Next.js: Update your Next.js configuration (usually in next.config.js) to point to the Tigris bucket URL for serving static assets. Here’s an example configuration:


module.exports = {
  // ... other configurations
  images: {
    domains: ['']

  • Redeploy Your App: After updating the configuration, redeploy your Next.js app using flyctl deploy to ensure the changes take effect.

Now, your static assets will be served directly from the Tigris bucket, offering benefits like:

  • Faster Loading Times: By offloading static assets to Tigris, your app itself becomes lighter, leading to faster loading times for users.
  • Scalability and Redundancy: Tigris ensures your static assets are highly available and can handle increased traffic without compromising performance.
  • Cost Optimization: Since you’re separating application code and static assets, you can potentially benefit from different pricing structures offered by for compute resources and object storage.

8. Additional Tips and Considerations

  • Environment Variables: Remember to store sensitive information like API keys or database credentials as environment variables and access them within your Next.js app code. offers secure management of environment variables.
  • Monitoring and Logging: provides built-in monitoring and logging tools to track your application’s performance and identify any potential issues.
  • Custom Domains: You can configure custom domain names for your deployed Next.js app on, enhancing your brand identity. Refer to the documentation for detailed instructions:
  • CI/CD Integration: integrates seamlessly with popular CI/CD platforms like GitHub Actions and GitLab CI/CD. This allows you to automate the deployment process whenever you push code updates to your repository.


By leveraging and Tigris, you’ve unlocked a powerful and efficient deployment solution for your Next.js application. provides a robust platform with global reach and automatic scaling, while Tigris ensures efficient management of your static assets. This combination empowers you to deliver a high-performance and cost-effective web experience for your users.

Remember, this blog post serves as a stepping stone. As you delve deeper into and Tigris, you’ll discover a wealth of advanced features and functionalities to customize your deployment strategy and optimize your Next.js application further. So, happy deploying!

Leave a Comment

Your email address will not be published. Required fields are marked *