Deploying: How to deploy an application on Diploi # Cloning a Deployment > How to clone an existing deployment In cases when you need to copy an entire deployment with the exact same configuration and database, such as cases when you need to work on a new feature branch that would involve changes to your database, you can use the clone feature to duplicate a deployment. *** ## Cloning a Deployment To clone a deployment, from the deployment’s dashboard, go to the tab **Options** and scroll to the bottom of the page. `https://console.diploi.com//project//deployment//options` ![Cloning a deployment](/_astro/CloningAction.Cl4E7AiM_Z29QmR7.png) Look for the **Clone Deployment** section, and there you can click on the **Clone this deployment** button to launch the deployment cloning wizard, which is very similar to the deployment creation workflow. ### Assigning a Deployment Type When cloning a deployment, you can also change its stage. So you could clone a Production deployment and then create a clone deployment intended for Development, using your Production data. ![Clone deployment stage selection](/_astro/CloningDeploymentStage.B7C6cPkz_Z12NfGh.png) For more information about the types of deployment stages, check [this article, which explains the differences between each type](/reference/deployments/deployment-lifecycle#deployment-stage). ### Selecting the Deployment Size After assigning the stage for the cloned deployment, you can choose the size that the deployment should have. The available deployment sizes include: \- **XS** - 2 vCPUs and 2 GB of ram - **0,006 €/hour** \- **S** - 2 vCPUs and 4 GB of ram - **0,014 €/hour** \- **M** - 2 vCPUs and 8 GB of ram - **0,048 €/hour** \- **L** - 4 vCPUs and 16 GB of ram - **0,089 €/hour** \- **XL** - 8 vCPUs and 32 GB of ram - **0,182 €/hour** ![Deployment size](/_astro/CreateDeploymentSize.Dfgzs_1Q_Z1pSL3G.png) ### Configuring Environment Variables Clone deployments inherit their Env values from the source deployment, which you can modify before launching the deployment. ![Environment variables for a cloned deployment](/_astro/DeploymentEnvVars.BZ4gR8uC_FVGk2.png) ### Launching a Cloned Deployment Once you have finished configuring the type and size of the deployment, along with modifying any environment variables, you are ready to launch by clicking on “Clone Deployment” which can be found at the bottom of the clone creation wizard. ![Starting a clone deployment](/_astro/LaunchClonedDeployment.DzM85TUn_1dIJ5r.png) # Creating a Deployment > How to create a new deployment for a project After you create a Project, a development deployment is automatically created for you, and you can create additional deployments for staging and production environments, or other development environments as needed. *** ## Launching a New Deployment To launch a new deployment, go to the **Deployments** tab inside of your Project: `https://console.diploi.com//project/` And there, you can click on the **Create Deployment** button to launch the deployment creation wizard. [The easiest way to start Remote Development Environments and code without local install using Diploi](https://www.youtube.com/embed/Xu96kVVzgqY?si=Gceaf_vBGXOhcb_x) ### Deployment Types To start a deployment, you have three different options: * **Development** which allows you to start a server on which you can start a remote development environment using VSCode or our cloud IDE, or connect directly to the server via SSH. For more about remote development, check out our [Remote Development guide](/building/remote-development/). * **Staging** to test your application and ensure stability before launching changes in your application to production. * **Production** to launch your application when it is ready to be used by your end users. ### Choosing a Deployment Size Once you choose the type of deployment you need, choose the size that the deployment should have. The available deployment sizes include: \- **XS** - 2 vCPUs and 2 GB of ram - **0,006 €/hour** \- **S** - 2 vCPUs and 4 GB of ram - **0,014 €/hour** \- **M** - 2 vCPUs and 8 GB of ram - **0,048 €/hour** \- **L** - 4 vCPUs and 16 GB of ram - **0,089 €/hour** \- **XL** - 8 vCPUs and 32 GB of ram - **0,182 €/hour** ![Deployment size](/_astro/CreateDeploymentSize.Dfgzs_1Q_Z1pSL3G.png) Once you have configured the type and size of your deployment, you can click on the **Create Deployment** button to start your deployment. ## Connecting via SSH to a Deployment If you need to connect via SSH to your deployment, you can do it by getting the SSH connection string from the “Components” and “Add-ons” sections found at the bottom of the “Overview” tab of your deployment, found at: `https://console.diploi.com//project//deployment/` From there, you can copy the SSH connection string for the component or add-on you want to connect to by clicking on the “Connect +” button next to the component or add-on. For more information on how to connect to your deployment via SSH, check out our [SSH guide](/building/add-ssh-key/). ![Connect to deployment with SSH](/_astro/CreateDeploymentConnect.BMKmN1OH_ZReKwQ.png) *** ## Shutting Down a Deployment If you want to stop a deployment from running, all you need to do is click on the “enabled” switch from the **Deployments** tab inside of your Project. ![Shutdown deployment](/_astro/DisableDeploymentCard.yJ5W_rmx_1IYAL7.png) Alternatively, you can also shutdown a deployment by clicking on the “enabled” switch found at the top of your Deployment’s status page. ![Shutdown switch](/_astro/DisableDeploymentSwitch.Bf_4-l1j_E19ir.png) You can restart your Deployment at any time by clicking on the same switch you used for shutdown. When you click on the switch, a dropdown will appear allowing you to choose the amount of time you want the deployment to be active for. ![Restart deployment](/_astro/EnableDeployment.BNAFhLoR_1AfNym.png) # Creating a Project > How to create a new project In Diploi, the process to host a new application online, starts by creating a new Project, which will let you the stack of the application you want to deploy, and then launching a Deployment which will run the application online. The overall process to launch a new application is as follows: ![Create a project diagram](/_astro/CreateProjectDiagram.DO-9rNPJ_2iYkiR.svg) ## Creating the Stack for a Project In Diploi, a project refers to a combination of **components** and **add-ons** (also called **services**) that form the **stack** that will make up your application. To create a project for your app click **Create Project** from your dashboard: `https://console.diploi.com//projects` Which will open the **Stack Builder** where you can choose the components and add-ons for your project. ### Selecting Components ![Project components](/_astro/CreateProjectComponents.BsGNnZs4_Z2yTI2.png) ### Selecting Add-ons ![Project add-ons](/_astro/CreateProjectAddons.DoZvxdrS_1fzVut.png) Once you have chosen the stack for your project, you will be able to see a preview of your selected stack. ### Stack Preview ![Create a project example](/_astro/CreateProjectPreview.Dib1Ltua_1cO0hS.png) In the preview you can edit the identifier for each component and add-on you have selected by clicking on the previewed elements of your stack. This will change the folder name of the components in your monorepo and the internal hostname of your add-ons. ![Create a project example](/_astro/CreateProjectEditNames.CB7Lv93s_9Cy7F.png) ### Choosing a GitHub Repository The last step before launching your project is to configure how your new application’s code will be stored. You have two options available: * **Launch Without a Repository** where you can launch a project without a repository to store your code. This is ideal for testing, where you can run simple scripts or applications which must be accessible online. Learn more about [Launch Without a Repository](/reference/projects/project#launch-without-a-repository). * **Create Repository** where a new repository will be created for your project. Ideal for launching new application intended for production. By creating a new repository for your project, you automagically enable Diploi’s push-to-deployment pipeline, where changes in your repository’s will update the state of your deployment. Learn more about [Create Repository](/reference/projects/project#project-with-repository). ![Create a project repo](/_astro/CreateProjectRepo.Do5EVvK9_p3IrQ.png) Now that you have selected your preferred stack and the configuration of your project, you can complete the creation of the project by clicking **Launch Stack**. For both types of projects, when you finish creating a new project, a new development deployment will be started for your project, which you can use to start developing your application right away. # Adding Custom Domains > Diploi offers the flexibility to configure custom domains on two levels. Diploi offers the flexibility to configure custom domains on two levels: at the **project** level and at the **deployment** level. ## Project At the project level, you can configure a custom `diploi.app` subdomain that will serve as the base domain for all autogenerated subdomains on deployments. Any new deployment created will automatically use the project’s domain as their base domain name. For example, if you configure `mycompany.diploi.app` as the custom domain at the project level, all autogenerated subdomains will be created as subdomains of `mycompany.diploi.app` (e.g. `app-production.mycompany.diploi.app`, `app-development.mycompany.diploi.app`, etc.). ## Deployment If you want to use a custom domain, eg. `mycompany.com` you can do it by defining a custom domain for a deployment. This provides more fine-grained control over your domain configuration and enables you to override the autogenerated subdomains created at the project level. ### Configuring a Custom Subdomain e.g. `app.example.com` All you need to do is: 1. Access your domain DNS records. 2. Create a new CNAME record, pointing to `edge.diploi.me` and using for name, the subdomain you want to use. 3. Add your custom domain in your Project or Deployment. ![Applying a custom domain](/_astro/ProjectOptionsDomain.BP4iVfxG_2ao5Qp.png) ### Configuring a Custom Root Domain e.g. `example.com` Root domains (also called apex or base domains) do not officially support CNAME records, which Diploi needs. Many DNS providers offer similar functionality with custom record types like ALIAS or ANAME.\ To point an apex domain to Diploi, you should refer to your DNS providers own instructions.\ We have created a table which lists the recommended records to use with some of the most popular DNS providers: | Provider | Record | Value | | ------------- | ------ | ---------------- | | Cloudflare | CNAME | `edge.diploi.me` | | DNS Made Easy | ANAME | `edge.diploi.me` | | DNSimple | ALIAS | `edge.diploi.me` | | DreamHost | ALIAS | `edge.diploi.me` | | easyDNS | ANAME | `edge.diploi.me` | | Namecheap | ALIAS | `edge.diploi.me` | | PointDNS | ALIAS | `edge.diploi.me` | | Porkbun | ALIAS | `edge.diploi.me` | # Hosting existing apps > Import your existing applications from GitHub and host them on Diploi If you already have an application that you would like to bring into Diploi, you can import it using **GitHub**. *** ## How to Import an Existing App into Diploi Diploi offers two ways to import projects, by selecting the repo you want to import from a list of available repositories in your GitHub account or by using the URL of a GitHub repo, either a public one or your own. 1. Start a new project ![Click on start new project](/_astro/StartAProject.Isp4kUS4_Z2dLtk7.png) 2. Then switch from “Start From Scratch” to the “Import Repository” tab ![Default import for applications that are not fully supported](/_astro/SwitchTabToImport.DLOq6Zl-_ZwBbLg.png) 3. Now you can select the source code you want to import. You can either select a repository stored in your own GitHub account or use a URL to import a public repo. 4. Once you have selected the repository you’ll import, click on the “Analyze Repository” button. Diploi will then look for the configuration files (`package.json`, ‘requirements.txt’, etc) and readme in your repository, to determine how to properly import your project to Diploi. ![Analyze repository before importing a project](/_astro/AnalyzeRepository.CKE2tA0q_Z1Fm61R.png) The import system will run an automated analysis, and conclude if your project can be hosted on Diploi or not. ![Analyzing the contents of an application](/_astro/AnalyzingRepository.BCuq2d5K_18nGN4.png) 5. After Diploi analyzes your repository, you’ll get a report which also tells you if you will need to do additional config work to properly host your application. ![Successful import and next steps](/_astro/SuccessImportResult.Da59tDnS_2i0r7S.png) The import system will generate a custom `diploi.yaml` file for your app, and you can also expand it by adding additional components and add-ons, like additional databases or services. For more about how to use the `diploi.yaml` file, [click here](/reference/diploi-yaml). ![Configuration summary for an imported project, ready to be launched](/_astro/ImportRepoFinalConfig.WYQfpUO__ZGk7ja.png) 6. Now you should have a development deployment running. If your project is not loading properly or fails to start, check the deployment logs. ### Other considerations #### Run command config By default, Diploi will use common run commands for development and staging/production deployments, so there might be some situations when your imported application might fail because your project uses different run commands. To handle these situations, you can either modify the `Dockerfile` and `Dockerfile.dev` created by diploi, or modify your app’s config to include the commands used by Diploi to run your application. #### Importing an external public repository When you can import a publicly available repository, which doesn’t belong to your GitHub account, you will have the option of creating a new repository in your account to store your code or start a project without a repository. In case you choose to proceed without a repo, your project won’t be able to start a Production or Staging deployment, because Diploi creates a [GitHub Actions workflow](/reference/github-action/) which takes care of creating a build of your project, which can be ran in Staging and Production. Caution You cannot add a repository to an existing project. If you need to import an application and link it to a new repository, you will need to go through the process of importing the app again and then create a new repository before launching the project. For more information about the differences between projects with or without a repository, [check this article going over their properties](/reference/projects/project#project-types). #### Importing an app from a repository you own When you import from a repo you own, Diploi will use the same repository by default to store your code, so any changes you make to your project can be pushed to the same repository you imported from. Currently, you can’t import a repository and save it in a new repository. ## Supported Applications Although it is technically possible to import any application, not every app will work right away, and they might require additional work in order to run properly after you import them to Diploi. You can **import any application built with Diploi**, or with any of these frameworks, databases, and technologies: #### Components available ![Supabase](https://github.com/diploi/component-supabase/blob/main/.diploi/icon.svg?raw=true) **Supabase** new ![FastAPI](https://github.com/diploi/component-fastapi/blob/main/.diploi/icon.svg?raw=true) **FastAPI** new ![n8n](https://github.com/diploi/component-n8n/blob/main/.diploi/icon.svg?raw=true) **n8n** new ![Flask](https://github.com/diploi/component-flask/blob/main/.diploi/icon.svg?raw=true) **Flask** new ![Laravel](https://github.com/diploi/component-laravel/blob/main/.diploi/icon.svg?raw=true) **Laravel** new ![Deno](https://github.com/diploi/component-deno/blob/main/.diploi/icon.svg?raw=true) **Deno** new ![Next.js](https://github.com/diploi/component-nextjs/blob/main/.diploi/icon.svg?raw=true) **Next.js** ![Node.js](https://github.com/diploi/component-nodejs/blob/main/.diploi/icon.svg?raw=true) **Node.js** ![Bun](https://github.com/diploi/component-bun/blob/main/.diploi/icon.svg?raw=true) **Bun** ![React + Vite](https://github.com/diploi/component-react-vite/blob/main/.diploi/icon.svg?raw=true) **React + Vite** ![Astro](https://github.com/diploi/component-astro/blob/main/.diploi/icon.svg?raw=true) **Astro** ![SvelteKit](https://github.com/diploi/component-sveltekit/blob/main/.diploi/icon.svg?raw=true) **SvelteKit** ![Nue](https://github.com/diploi/component-nue/blob/main/.diploi/icon.svg?raw=true) **Nue** ![Ghost](https://github.com/diploi/component-ghost/blob/main/.diploi/icon.svg?raw=true) **Ghost** ![Hono](https://github.com/diploi/component-hono/blob/main/.diploi/icon.svg?raw=true) **Hono** ![ASP.NET](https://github.com/diploi/component-asp/blob/main/.diploi/icon.svg?raw=true) **ASP.NET** ![Lovable](https://github.com/diploi/component-lovable/blob/main/.diploi/icon.svg?raw=true) **Lovable** ![Blazor](https://github.com/diploi/component-blazor/blob/main/.diploi/icon.svg?raw=true) **Blazor** ![Static Website](https://github.com/diploi/component-static/blob/main/.diploi/icon.svg?raw=true) **Static Website** ![Django](https://github.com/diploi/component-django/blob/main/.diploi/icon.svg?raw=true) **Django** beta ![Python](https://github.com/diploi/component-python/blob/main/.diploi/icon.svg?raw=true) **Python** beta #### Add-ons available ![PostgreSQL](https://github.com/diploi/addon-postgres/blob/main/.diploi/icon.svg?raw=true) **PostgreSQL** ![MongoDB](https://github.com/diploi/addon-mongo/blob/main/.diploi/icon.svg?raw=true) **MongoDB** ![Redis](https://github.com/diploi/addon-redis/blob/main/.diploi/icon.svg?raw=true) **Redis** ![MariaDB](https://github.com/diploi/addon-mariadb/blob/main/.diploi/icon.svg?raw=true) **MariaDB** ![MinIO](https://github.com/diploi/addon-minio/blob/main/.diploi/icon.svg?raw=true) **MinIO** ### Apps built on Diploi Any application built on Diploi can be imported into a new project without any additional configuration. Diploi will provision any component and add-on specified in the `diploi.yaml` file, but with the caveat that any environment variables used in the project must then be set manually, since Diploi doesn’t store the project’s secrets on GitHub. ![Additional example importing an app built with Diploi](/_astro/RepositoryCreatedWithDiploiImport2.MsIfIfYq_Z20E8tK.png) ### Apps built on Lovable If you built a project on Lovable, you can seamlessly import it to Diploi. All you need to do is sync your application on GitHub. For Lovable projects using Supabase, you can use the open-source version of Supabase that is available on Diploi. You can add Supabase by adding the snippet to your `diploi.yaml` file. ```plaintext - name: Supabase identifier: supabase package: https://github.com/diploi/component-supabase#main ``` Paste the snippet within the `components` field in the `diploi.yaml`, usually found in the root of your project. ```plaintext components: - name: Lovable ... - name: Supabase identifier: supabase package: https://github.com/diploi/component-supabase#main ``` If you would like a detailed walkthrough about how to import an application built with Lovable, [click here to check our tutorial explaining how to do it](https://diploi.com/blog/importing_from_lovable_and_github). We also have a guide walkthrough explaining how to use Cursor for your imported Lovable app, which [you can check by clicking here](https://diploi.com/blog/exporting_from_lovable_to_cursor). #### Running Supabase Migrations after Importing a Lovable App If you are using the Lovable project with Supabase, you’ll need to run the necessary migrations, which should be stored inside your Supabase folder, as `migrations`. You can apply the migrations to your new Supabase instance by running the command `supabase migration up` from the development environment created when you import the project. # Resizing Disk Storage > How to increase the disk storage of a deployment using the Storage Selector Every deployment in Diploi includes persistent disk storage used by your components, add-ons, and data. By default, new deployments start with **5 GB** of storage. As your application grows and your data needs increase, you can expand the disk size directly from the deployment dashboard. Important Disk resizing is a **one-way operation**. You can increase the storage size of your deployment, but you cannot decrease it afterward. Plan your storage needs carefully before resizing, as this change is permanent. *** ## Viewing Disk Usage From the **Overview** tab of your deployment, the **Cluster** panel displays real-time resource usage for your deployment, including RAM, CPU, and Disk. The **Disk** section shows how much storage your deployment is currently using, broken down by category: Code, Home, PostgreSQL, Devpod, etc. This gives you a quick overview of where your storage is being consumed. ![Disk usage monitor with Resize button](/_astro/ResizeDisk.BnVMVoKf_Z1Fzv1S.png) *** ## Resizing the Disk To increase your deployment’s storage, click the **Resize** button located next to the Disk usage indicator in the Cluster panel. This will open the **Resize Disk** dialog, where you can use the slider to increase your deployment’s storage in 5 GB increments. ![Resize Disk dialog](/_astro/ResizeDiskAction.Cf1k7k51_23qvXA.png) Resizing storage will affect your monthly costs. You can review the pricing before confirming by visiting our [pricing page](https://diploi.com/pricing) and checking how much you would pay for the new storage you plan to allocate. ![Recalculating the storage costs](/_astro/StorageCostCalculator.PP4U8ZXu_1iwWTd.png) Once you have selected the desired size, click the **Resize** button to confirm. The additional storage will be made available to your deployment. *** ## See also * [Creating a Deployment](/deploying/creating-a-deployment) * [Deployment Lifecycle](/reference/deployments/deployment-lifecycle)