Enjoy Infomaniak IaaS Public Cloud with Laravel Forge

Search for a command to run...

No comments yet. Be the first to comment.
Now that we have set up all the tools to create blocks on both Twill and Vue sides, let's create some generic blocks. Each block will be created in the Common namespace and will be manually added as an allowed block in the controller of our PageConte...

Now that we can create pages, it's time to leverage Twill's powerful content management features and construct reusable blocks. In this article, we will focus on creating a basic Title Twill Block (with a translatable Twill Text Input in a Common nam...

You are probably already familiar with the work of Spatie and its contributors in the Laravel and Open Source ecosystem. For many years, we have been using their Backup package (https://spatie.be/docs/laravel-backup) to back up our applications (data...

If a Twill module uses Revisions, you can benefit from an awesome Twill feature: preview your changes before publishing and compare old revisions. By default, it uses Blade views, so working with Inertia needs some adjustments. The principle For now,...

In this article, we will see the creation and customization of a Twill singleton module to provide a Homepage for our application. Singleton module creation In Twill terminology, a Singleton Module is globally like a classic module except that it man...

Infomaniak released a new service on September 28, 2021: Public Cloud, an IaaS based on Debian and OpenStack . It's the infrastructure they already use for their own services, hosted in Switzerland and committed to a sustainable economy and customer privacy (ISO 14001, ISO 50001, ISO 27001).
Laravel Forge is a server management solution for easy provisioning, management and deployment of PHP applications (push to deploy, accessible configuration, database backup, SSL certificates, ...) provided by the Laravel squad.
As Laravel Forge doesn't support Infomaniak as a provider (for now), there are some additional steps to make it work together.
We assume you already have an account on Laravel Forge, Infomaniak and that you created a project on the Public Cloud service.
Here are the steps to have a running and managed server:
Once you are on your project page, go to Compute > Instances menu and click on Launch Instance button.

You now have a modal window requiring information you have to fill in multiple steps:

Just give your Instance a name (and a description if you want). You don't need to set an availability zone.

Laravel Forge supports Ubuntu 20.04 x64 and Ubuntu 22.04 x64: add Ubuntu 22.04 LTS from the list if your application needs at least PHP 8.1 version, otherwise add Ubuntu 20.04 x64.

Here you have to choose the flavor of your Instance (CPU, RAM, storage). You can find the pricing for each Instance flavor here: https://www.infomaniak.com/en/hosting/public-cloud/prices

Select the provided Infomaniak IPV4 external network ext-net1.
Nothing specific to do here.

Here you define the opened ports (entering and exiting) and authorized IP addresses of your Instance, using Security Groups feature.
Keep default, for now you will create and add ssh (to allow Laravel Forge to manage your Instance), http and https (to make your Web application reachable) access afterwards.
If you didn't add a SSH key previously, you can import it here.

You can now associate it to your Instance.

Nothing specific to do here.
Nothing specific to do here.
Nothing specific to do here.
Nothing specific to do here.
All is now set, you can launch your Instance

and see it running a few seconds later.

On a fresh Infomaniak Public Cloud project, there's no Security Groups created to allow SSH and Web access, you have to create them (you will be able to reuse them on the other Instances you will create in your project afterwards).
To do so, go to Network > Security Groups menu and click on Create Security Group button.

On the opening modal window, give your Security Group a name (and a description if you want) and click on Create Security Group button.

By default, the Security Group gives exiting (Egress) access to any IP on any port. You don't need those rules as they already are set in the default Security Group, you can then delete them.
You can now add the Rule you need, so click on Add Rule button.
On the opening modal window, you can see a predefined list of protocols, select SSH. You can also filter the allowed IP addresses (for Laravel Forge and your own IP addresses for example, you will allow everybody for the moment).


Follow the same steps as for SSH for the Security Group creation and default Rules deletion.

Then, for this Security Group, you will add 2 Rules (that are also predefined):
As you want everybody to have access to our Web application, you don't filter IP addresses.
You can now go back to the Compute > Instances menu, and in the Actions column of your Instance, click on Edit Security Groups

You can now add your ssh and web Security Groups:

Once saved, the rules are instantly applied. All is done now for the Infomaniak Public Cloud part (and it will be quicker for the next Instances, as you'll be able to add the ssh and web Security Groups directly on Instance creation).
On the Server creation section, select Custom VPS.

On the form that appears:
You will now see a modal window where you can find:
Don't click on Close too quickly and keep those information somewhere secure.

For a supported Provider, Laravel Forge runs the script automatically without requiring any further action from you. But with Custom Providers, it is to us to run it manually, so:
ssh ubuntu@195.15.xxx.xxx
sudo -s
root@my-server:/home/ubuntu#
wget -O forge.sh "https://forge.laravel.com/servers/XXXXXX/vps?forge_token=xxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXXxxxxxXXxxXXXXxxxxXXXxxxXXXxxxXXXXXX&recipe=";
bash forge.sh
If you go back to Laravel Forge and look at your Server, you should now see it being prepared.

Here you are, the Instance is running, installed, configured, managed and the default Laravel Forge site is deployed, you can open a browser and go to your Instance IP address to confirm

And of course, you can now deploy your PHP application and enjoy the Infomaniak infrastructure and Laravel Forge quick deploy feature!