Creating a Space
Now that we have a usable template, we can create a space from it. You can create as many spaces as needed from a single template. If a template is updated, users with spaces created from that template will be prompted to restart their spaces to apply the updates.
Step 1: Create a Space
- From the
Templatespage, click the menu icon (three dots) next to the template you want to use, then selectCreate Space.
- Fill out the form with the following details:
- Space Name: Enter
phptest. - Optionally, click
More optionsto show the rest of the form, where you can set a Description (for exampleA test PHP space.), change the Icon shown for the space, and pick the Terminal Shell you’d like to use. The defaults suit most spaces, and everything can be changed later.
- Space Name: Enter
- Leave the
Start Space on Createoption checked, then clickCreate. You’ll be returned to theSpacespage, where the new space will now be visible.
Step 2: Monitor the Space Status
- While the space is starting, its Status will show as
Starting. - Once the space is running, the Status will change to
Running, and icons will appear, allowing access to the space’s features.
Once the space is running the icons will show:
- Terminal: Clicking the terminal icon opens a new window with a web terminal inside the space. The shell will match the one selected during space creation.
- Ports: Clicking the ports icon opens a dropdown showing the list of ports the space exports. For this example, the first port is the web server. Clicking it will open a new window displaying the content served by the web server.
Step 3: Add a PHP Script
- Click the
Webitem in thePortsmenu to open the web browser. At this point, the server will display an empty folder since no content has been added yet. - Click the
Terminalicon to open a web terminal. Create a PHP file in thepublic_htmldirectory that runsphpinfo:
echo "<?php phpinfo();" > public_html/index.phpStep 4: View the PHP Script
- Click the
Web (80)item in thePortsmenu. The web page will open, running the new script and displaying the PHP information.
Step 5: Stop and Restart the Space
-
To stop the space, click the menu icon (three dots) next to the space, then select
Stopfrom the menu. -
Since the template was created with a persistent volume, restarting the space from the menu will restore it to the state it was in when it was stopped.