Documentation & Tutorials


How to Create and Connect to Your First Server

Overview

This page shows how to create and connect to your first Scaleway cloud compute instance. A cloud instance is a computing unit, either virtual or physical that provides resources to run your applications on.

After you’ve launched your cloud instance, you can connect to it as root and use it as you wish.

There are six steps to provision a new server:

  • Choose an image
  • Choose a region
  • Choose a server type
  • (Optional) Adding additional storage
  • Configure advanced option
  • Name and tag the instance

Important: Your SSH public keys are fetched during the boot process.

If you add them after your server is booted, they will not be added to your authorized_keys file.

If you do not want the keys to be downloaded during the next boot, execute the following command on your server:

root@c1-X-Y-Z-T:~# echo manual > /etc/init/ssh-keys.override

Requirements

Creating a Server

Before starting, click the “Create Server” button in the control panel.

Control Panel

Choosing an Image

Start by choosing an image for the cloud instance.

You can choose an image from four sources:

  • OSes: Choose your favourite basic Linux distribution, ready to be configured by you.

  • InstantApps: We provide an up-to-date list different pre-installed applications.

  • My images: You can populate your own list of server templates. See also Create your own image

  • Snapshots: You can recover a server from a previously saved state. See also Backup your data with snapshots

Choosing a Region

You can choose a region in which your instance will be deployed geographically.

Currently we provide the following locations:

  • PAR1: Paris, France
  • AMS1: Amsterdam, The Netherlands

Choosing the Server Type

Choose the type of the instance that you want to deploy.

You can choose from the following instance types:

  • Start: Entry-level servers that provide the best price-performance ratio. Typically, those servers are used for small/medium volumetry website, blog, VPN, torrent services.
  • BareMetal: These servers are designed for the cloud and for horizontal scaling. You can add additional SSD volumes to get as much as 1TB of SSD storage per server. Our BareMetal cloud server are real dedicated servers and each physical server is allocated to a single customer and one only.
  • Pro: Medium-level servers that are typically suited for professional usage. Typically, those servers would host application that need more resources to be run.
  • ARM: ARMv7 and ARMv8 SSD Cloud Servers built for developers.

Adding additional storage

A simple solution to increase the storage for your servers is to add extra volumes.

Several volumes can be attached to an instance. In addition, they can be snapshotted, mounted or unmounted.

Configuring advanced options

You can configure advanced options of your server, including:

Naming and tagging the instance

Edit the following information about the instance:

  • The instances name
  • The tag you want to assign to it (Optional). Tags let you organize your servers, you can assign any tag to each server.

Starting the Instance

Click the “Create a new Server” button. This action launches the create server action. The instance will be ready soon after.

Logging into the Instance

When your instance is running, the server’s IP address is visible in the server list on the control panel.

On OSX and Linux

On a Mac or Linux computer, open a terminal program and type the following command in the shell:

john@localhost:~$ ssh -i ~/.ssh/your_private_key root@your_server_ip

Allow connection to the host:

The authenticity of host 'myhost.ext (212.47.226.35)' can't be established.
RSA key fingerprint is 4f:ba:65:cf:14:64:a7:1e:b6:07:7c:00:71:95:21:fa.
Are you sure you want to continue connecting (yes/no)?

Well done, you are now logged into your server!

On Windows

On Windows, you will need a small application named PuTTy, an SSH client. Download putty here.

Once you have downloaded PuTTY, just start the program.

  • Fill the “Hostname” field with your server’s IP address
  • In the left-side menu, under Connection, expand the SSH sub-category
  • Select the Auth sub-category and click the “Browse” button
  • Select the private key file you generated previously
  • Return in the Session category and click the “Open” button

Import your SSH key on Putty

You are now logged into your server from Windows.

Mounting Additional Volumes

Formatting Additional Volumes

If the new volume has never been formatted, it has to be formatted using mkfs before you can mount it.

For instance, the following command creates an ext4 file system on the volume:

root@c1-X-Y-Z-T:~# mkfs -t ext4 /dev/nbd1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
610800 inodes, 2441406 blocks
122070 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2503999488
75 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks:
  32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Mounting Additional Volumes Manually

To mount the device manually as /mnt/data, run the following commands:

root@c1-X-Y-Z-T:~# mkdir -p /mnt/data
root@c1-X-Y-Z-T:~# mount /dev/nbd1 /mnt/data
root@c1-X-Y-Z-T:~# ls -la /mnt/data/
total 24
drwxr-xr-x 3 root root  4096 Jan  1 00:07 .
drwxr-xr-x 3 root root  4096 Jan  1 00:07 ..
drwx------ 2 root root 16384 Jan  1 00:07 lost+found

Mounting Additional Volumes Automatically with systemd

To mount the additional volume automatically, create a systemd script that will mount the volumes automatically during the boot of your cloud server.

If not yet done, create the directory into you want to mount your volume: mkdir -p /mnt/data

As the volume is empty by default, you have to create a filesystem before you can use it. To format it with with an ext4 filesystem, use the following command: mkfs -t ext4 /dev/nbd1

To get the UUID of your volume, run the command blkid and take a note of the ID as you will need it in the next step.

Create or edit the file that corresponds to the path of your directory nano /etc/systemd/system/mnt-data.mount and edit is as following: The file name of the script must correspond to the path where you mount the volume (/mnt/datamnt-data.mount)

[Unit]
Description=Mount NDB Volume at boot

[Mount]
What=UUID="16575a81-bb2c-46f3-9ad8-3bbe20157f7c"
Where=/mnt/data
Type=ext4
Options=defaults

[Install]
WantedBy=multi-user.target

Replace UUID with the ID of your volume.

Now reload systemd: systemctl daemon-reload Launch the script to mount the volume: systemctl start mnt-data.mount Finally enable the script to mount your volume automatically during boot: systemctl enable mnt-data.mount

Your volume will automatically be mounted after a reboot. You can run the df -h command, this command will list all your devices and where they are mounted:

root@scw-65acb0:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev           1009M     0 1009M   0% /dev
tmpfs           203M   12M  191M   6% /run
/dev/nbd0        46G  454M   43G   2% /
tmpfs          1011M     0 1011M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1011M     0 1011M   0% /sys/fs/cgroup
/dev/nbd1        46G   52M   44G   1% /mnt/data

Discover a New Cloud Experience

Deploy SSD Cloud Servers in seconds.